In module Test§

See primary documentation in context for sub exits-ok.

multi exits-ok($code, $exit, $reason)

Marks a test as passed if the given $code exits with the given $exit code.

The routine accepts an optional description ($reason) for the test.

exits-ok({ say 3; exit 4}, 4, "exited with the right code") # passes