Sha256: 54fa28f83cafdb4673dfa5aa93be9b2c3a7a054440594177a46760bb7fb659c5

Contents?: true

Size: 1.9 KB

Versions: 119

Compression:

Stored size: 1.9 KB

Contents

#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;{{#cdata}}
my $dir;{{/cdata}}
use lib{{#cdata}} $dir ={{/cdata}} $FindBin::Bin;{{#lib_comment}} {{&lib_comment}}{{/lib_comment}}{{#cdata}}
use JSON::PP;{{/cdata}}{{#modules}}
use {{&use}};{{/modules}}

my $exercise{{#exercise}} = '{{&exercise}}'{{/exercise}};{{#exercise_comment}} {{&exercise_comment}}{{/exercise_comment}}
my $test_version{{#version}} = {{&version}}{{/version}};{{#version_comment}} {{&version_comment}}{{/version_comment}}
my $module = $ENV{EXERCISM} ? 'Example' : $exercise;{{#module_comment}} {{&module_comment}}{{/module_comment}}
use Test::More{{#plan}} tests => {{&plan}}{{/plan}};{{#plan_comment}} {{&plan_comment}}{{/plan_comment}}

use_ok $module or BAIL_OUT;{{#use_test_comment}} {{&use_test_comment}}{{/use_test_comment}}
{{#version_test_comment}}

{{&version_test_comment}}{{/version_test_comment}}
my $exercise_version = $exercise->VERSION // 0;
if ($exercise_version != $test_version) {
  warn "\nExercise version mismatch. Further tests may fail!"
    . "\n$exercise is v$exercise_version. "
    . "Test is v$test_version.\n";
  BAIL_OUT if $ENV{EXERCISM};
}
{{#subs}}

my %subs;
foreach ( qw({{&subs}}) ) {
  can_ok $exercise, $_;
  $subs{$_} = $exercise->can($_);
}
{{/subs}}{{#cdata}}
my $C_DATA;{{/cdata}}
{{&tests}}
{{#cdata}}{{#cdata_test_comment}}
{{&cdata_test_comment}}{{/cdata_test_comment}}
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';
}
{{/cdata}}

done_testing;{{#done_testing_comment}} {{&done_testing_comment}}{{/done_testing_comment}}{{#after_done_testing}}

{{&after_done_testing}}{{/after_done_testing}}{{#cdata}}
{{#INIT_comment}}

{{&INIT_comment}}{{/INIT_comment}}
INIT {
$C_DATA = decode_json <<'EOF';

{{&json}}
EOF
}{{/cdata}}

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
trackler-2.2.1.84 tracks/perl5/templates/test.mustache
trackler-2.2.1.83 tracks/perl5/templates/test.mustache
trackler-2.2.1.82 tracks/perl5/templates/test.mustache
trackler-2.2.1.81 tracks/perl5/templates/test.mustache
trackler-2.2.1.80 tracks/perl5/templates/test.mustache
trackler-2.2.1.79 tracks/perl5/templates/test.mustache
trackler-2.2.1.78 tracks/perl5/templates/test.mustache
trackler-2.2.1.77 tracks/perl5/templates/test.mustache
trackler-2.2.1.76 tracks/perl5/templates/test.mustache
trackler-2.2.1.75 tracks/perl5/templates/test.mustache
trackler-2.2.1.74 tracks/perl5/templates/test.mustache
trackler-2.2.1.73 tracks/perl5/templates/test.mustache
trackler-2.2.1.72 tracks/perl5/templates/test.mustache
trackler-2.2.1.71 tracks/perl5/templates/test.mustache
trackler-2.2.1.70 tracks/perl5/templates/test.mustache
trackler-2.2.1.69 tracks/perl5/templates/test.mustache
trackler-2.2.1.68 tracks/perl5/templates/test.mustache
trackler-2.2.1.67 tracks/perl5/templates/test.mustache
trackler-2.2.1.66 tracks/perl5/templates/test.mustache
trackler-2.2.1.65 tracks/perl5/templates/test.mustache