exercise: AllYourBase version: 2 plan: 23 imports: '&convert-base' tests: | sub test ($case, $expected) { is-deeply &::('convert-base')(|$case), $expected, $case } for @($c-data) { when . ~~ Array { test $_, . } when . ~~ /base|digit/ { throws-like {&::('convert-base')(|.)}, Exception, . } when . eq 'leading zeros' { test $_, [4,2] } when . eq 'empty list' { test $_, [] } when . ~~ /zero/ { test $_, [0] } default { flunk . } # To ensure that no canonical-data cases are missed. }