2.34. harness
Test harness block. Similar to try/catch. Interprets the body text and checks the return value against expected and explicitly bad cases.
Returns DIED, OK, or NOT OK message along with your result if not the expected value.
2.34.1. Summary
[harness expected="good" name=my_test_number_1] [good]The Expected Return Value[/good] [not]Some Specifically Bad Return Value[/not] Tags and code to test here [/harness]
No parameters.
- expected (default "OK")
- Tagname for delimiting your expected return value
- name (default "testnnn")
- This will appear in your output message (useful for distinguishing harness tags from one another)
The attribute hash reference is passed after the parameters but before the container text argument. This may mean that there are parameters not shown here.
Must pass named parameter interpolate=1 to cause interpolation.
This is a container tag, i.e. [harness] FOO [/harness]. Nesting: NO
Invalidates cache: no
Called Routine:
ASP-like Perl call:
$Tag->harness( { }, BODY ) OR $Tag->harness($ATTRHASH, $BODY);
2.34.2. Description
Test harness block. Similar to try/catch. Interprets the body text and checks the return value against expected and explicitly bad cases.
Returns DIED, OK, or NOT OK message along with the harness name and your result if not the expected value.