tracks/perl6/exercises/phone-number/phone-number.t in trackler-2.2.1.48 vs tracks/perl6/exercises/phone-number/phone-number.t in trackler-2.2.1.49

- old
+ new

@@ -5,13 +5,11 @@ use JSON::Fast; my Str:D $exercise := 'Phone'; my Version:D $version = v3; my Str $module //= $exercise; -INIT { - plan 14; -} +plan 14; use-ok $module or bail-out; require ::($module); if ::($exercise).^ver !~~ $version { @@ -30,12 +28,23 @@ } else { nok clean-number(.<phrase>), .<description>; } } -done-testing; +unless %*ENV<EXERCISM> { + skip-rest 'exercism tests'; + exit; +} +subtest 'canonical-data' => { + (my $c-data-file = "$dir/../../problem-specifications/exercises/{ + $dir.IO.resolve.basename + }/canonical-data.json".IO.resolve) ~~ :f ?? + is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !! + flunk 'problem-specifications file not found'; +} + INIT { $c-data := from-json q:to/END/; { "exercise": "phone-number", @@ -126,21 +135,7 @@ ] } END - if %*ENV<EXERCISM> { - $module = 'Example'; - if (my $c-data-file = - "$dir/../../problem-specifications/exercises/{$dir.IO.resolve.basename}/canonical-data.json" - .IO.resolve) ~~ :f - { - is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'canonical-data'; - } - else { - flunk 'canonical-data'; - } - } - else { - skip; - } + $module = 'Example' if %*ENV<EXERCISM>; }