asserts.checkerror(command, expectedMessage)
asserts.checkerror(command, expectedMessage, expectedIdentifier)
[res, msg] = asserts.checkerror(command, expectedMessage)
| Parameter | Description |
|---|---|
| command | Command string evaluated in the current context. |
| expectedMessage | Expected full error message. |
| expectedIdentifier | Optional expected error identifier. |
| Parameter | Description |
|---|---|
| res | true if the assertion passes, false otherwise. |
| msg | assertion failure message, empty on success. |
The assertion passes only when the command raises the expected error.
Use asserts.throws when only a message substring must match.
asserts.checkerror('cos', _('Wrong number of input arguments.'));
[res, msg] = asserts.checkerror('1 + 1', _('unused'));
| Version | Description |
|---|---|
| 2.0.0 | initial version |