The verify error instruction is used to verify (to ensure) that an error occurred during the execution of a test instruction.
This is useful to test any situation that must produce a runtime error. For example, it enables us to verify that a command really produces a runtime error if it is called with an invalid input argument value.
The verify error instruction can only be used in test scripts (see the section called “test script”) and it is typically executed after a test instruction.
Table 8.30. verify error syntax
| Production | Syntax | Links |
|---|---|---|
verify_error_instruction |
"verify" "error" error_info ?
| the section called “verify error instruction” |
error_info |
( "error_message" ":" expression ) ? ( "error_id" ":" identifier ) ? ( "error_data" ":" expression ) ?
| the section called “error info” |
error_info is an optional clause used to create more specific error data if the verification failed. For more information, see the section called “error info”