tracks/perl5/exercises/hello-world/hello-world.t in trackler-2.2.1.104 vs tracks/perl5/exercises/hello-world/hello-world.t in trackler-2.2.1.105
- old
+ new
@@ -27,38 +27,32 @@
foreach ( qw(hello) ) {
can_ok $exercise, $_;
$subs{$_} = $exercise->can($_);
}
-my $C_DATA;
+my $C_DATA = do { local $/; decode_json(<DATA>); };
is $subs{hello}->($_->{input}), $_->{expected}, $_->{description} foreach @{$C_DATA->{cases}};
# Ignore this for your exercise! Tells Exercism folks when exercise cases become out of date.
SKIP: {
skip '', 1 unless $ENV{EXERCISM};
- is_deeply eval q{
- use Path::Tiny;
- decode_json path("$dir/../../problem-specifications/exercises/".path($dir)->basename.'/canonical-data.json')->realpath->slurp;
- }, $C_DATA, 'canonical-data';
+ TODO: {
+ local $TODO = 'update canonical-data';
+ is_deeply eval q{
+ use Path::Tiny;
+ decode_json path("$dir/../../problem-specifications/exercises/".path($dir)->basename.'/canonical-data.json')->realpath->slurp;
+ }, $C_DATA, 'canonical-data';
+ }
}
-done_testing; # There are no more tests after this :)
-
-# 'INIT' is a phaser, it makes sure that the test data is available before everything else
-# starts running (otherwise we'd have to shove the test data into the middle of the file!)
-INIT {
-$C_DATA = decode_json <<'EOF';
-
+__DATA__
{
"exercise": "hello-world",
"version": "1.0.0",
"cases": [
{
"description": "Say Hi!",
"property": "hello",
"expected": "Hello, World!"
}
]
-}
-
-EOF
}