asserts.fail()
asserts.fail(message)
[res, msg] = asserts.fail(message)
| Parameter | Description |
|---|---|
| message | Optional custom failure message. |
| Parameter | Description |
|---|---|
| res | true if the assertion passes, false otherwise. |
| msg | assertion failure message, empty on success. |
Use this assertion to mark an execution path that must not be reached.
With outputs, no error is raised and res is false.
[res, msg] = asserts.fail('unreachable branch');
try; asserts.fail('unreachable branch'); catch ME; disp(ME.message); end
| Version | Description |
|---|---|
| 2.0.0 | initial version |