Documentation for sub
ok assembled from the following types:
multi sub ok(Mu , = '')
ok function marks a test as passed if the given
$value evaluates to
nok function marks a test as passed if the given value evaluates to
False. Both functions accept an optional description of the test as second parameter.
my ; my ; ...;ok .success, 'HTTP response was successful';nok .error, 'Query completed without error';
In principle, you could use
ok for every kind of comparison test, by including the comparison in the expression passed to
sub factorial() ;ok factorial(6) == 720, 'Factorial - small integer';
However, where possible it's better to use one of the specialized comparison test functions below, because they can print more helpful diagnostics output in case the comparison fails.