sub done-testing

Table of Contents

Specify that testing has finished. Use this function when you don't have a plan with the number of tests to run. A plan is not required when using done-testing.

It's recommended that the done-testing function be removed and replaced with a plan function when all tests are finalized. Use of plan can help detect test failures otherwise not reported because tests were accidentally skipped due to bugs in the tests or bugs in the compiler. For example:

subdo-stuff{@};

useTest;

ok.is-primefordo-stuff;

done-testing;

# output:

1..0

The above example is where a done-testing fails. do-stuff() returned nothing and tested nothing, even though it should've returned results to test. But the test suite doesn't know how many tests were meant to be run, so it passes.

Adding plan gives a true picture of the test:

subdo-stuff{@};

useTest;

plan1;

ok.is-primefordo-stuff;

# output:

1..1

# Looks like you planned 1 test, but ran 0

Note that leaving the done-testing in place will have no effect on the new test results, but it should be removed for clarity.

This is a work in progress to document Raku (formerly known as Perl 6), and
known to be incomplete.