Course of Raku / Advanced / Testing and documentation 🆕 / Testing 🆕 / Exercises / A first test

Solution: A first test

Here is a possible solution to the task.

Code

use Test;

ok 'Raku'.chars == 4, 'Raku has four letters';

done-testing;

🦋 You can find the source code in the file a-first-test.raku.

Output

ok 1 - Raku has four letters
1..1

Comments

  1. ok passes because the condition 'Raku'.chars == 4 is true.

  2. done-testing emits the plan line 1..1, stating that one test ran.

Course navigation

A first test   |   Compare values