tracks/perl6/exercises/flatten-array/flatten-array.t in trackler-2.1.0.48 vs tracks/perl6/exercises/flatten-array/flatten-array.t in trackler-2.1.0.49
- old
+ new
@@ -1,10 +1,10 @@
#!/usr/bin/env perl6
use v6;
use Test;
use lib my $dir = $?FILE.IO.dirname;
-use JSON::Tiny;
+use JSON::Fast;
my $exercise = 'FlattenArray';
my $version = v1;
my $module = %*ENV<EXERCISM> ?? 'Example' !! $exercise;
plan 8;
@@ -22,12 +22,14 @@
require ::($module) <&flatten-array>;
my $c-data;
is-deeply &::('flatten-array')(.<input>), |.<expected description> for @($c-data<cases>);
-if %*ENV<EXERCISM> && (my $c-data-file =
- "$dir/../../x-common/exercises/{$dir.IO.resolve.basename}/canonical-data.json".IO.resolve) ~~ :f
-{ is-deeply $c-data, from-json($c-data-file.slurp), 'canonical-data' } else { skip }
+if %*ENV<EXERCISM> {
+ if (my $c-data-file = "$dir/../../problem-specifications/exercises/{$dir.IO.resolve.basename}/canonical-data.json".IO.resolve) ~~ :f {
+ is-deeply $c-data, EVAL('use JSON::Fast; from-json($c-data-file.slurp);'), 'canonical-data';
+ } else { flunk 'canonical-data' }
+} else { skip }
done-testing;
INIT {
$c-data := from-json q:to/END/;