sub ok

Documentation for sub ok assembled from the following types:

module Test

From Test

(Test) sub ok

Defined as:

multi sub ok(Mu $cond$desc = '')

The ok function marks a test as passed if the given $cond evaluates to True. It also accepts an optional description of the test as second argument.

my $responsemy $query...;
ok $response.success'HTTP response was successful';

In principle, you could use ok for every kind of comparison test, by including the comparison in the expression passed to $cond:

sub factorial($x{ ... };
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.