Assert
Synopsis
Tests an assertion on specified elements.
Description
Assert evaluates target as a list of elements. Then, for each element, evaluates assertion as a boolean. Assert reports each element for which assertion is false
. Assert aborts the processing of the corpus if severe is true
.
Snippet
<assert class="Assert">
<assertion></assertion>
<target></target>
</assert>
Mandatory parameters
assertion
Expression evaluated as a boolean with the target element as the context element. This parameter specifies the assertion to be checked on each target.
target
Expression evaluated as a list of elements with the corpus as the context element. This parameter specifies the elements on which the assertion is checked.
Optional parameters
message
Customize the assertion failure message. This expression is evaluated as a string from the failed target.
outFile
Path to the file where to record assertion failures. If not set then assertion failures are not recorded, and only displayed on the log.
stopAt
Maximum number of assertion failures before Assert will stop checking.
severe
If true
and there is at least one assertion failure, then Assert will abort the processing of the corpus.