tracks/perl6/exercises/rna-transcription/rna-transcription.t in trackler-2.1.0.48 vs tracks/perl6/exercises/rna-transcription/rna-transcription.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 = 'RNA'; my $version = v1; my $module = %*ENV<EXERCISM> ?? 'Example' !! $exercise; plan 10; @@ -28,22 +28,24 @@ } else { throws-like {.<dna>.&to-rna}, Exception; } } -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/; { "exercise": "rna-transcription", - "version": "1.0.0", + "version": "1.0.1", "comments": [ "Language implementations vary on the issue of invalid input data.", "A language may elect to simplify this task by only presenting valid", "test cases. For languages handling invalid input data as", "error conditions, invalid test cases are included here and are", @@ -54,52 +56,52 @@ "Alternative interpretations such as ignoring excess length at the end", "are not represented here." ], "cases": [ { - "description": "rna complement of cytosine is guanine", + "description": "RNA complement of cytosine is guanine", "property": "toRna", "dna": "C", "expected": "G" }, { - "description": "rna complement of guanine is cytosine", + "description": "RNA complement of guanine is cytosine", "property": "toRna", "dna": "G", "expected": "C" }, { - "description": "rna complement of thymine is adenine", + "description": "RNA complement of thymine is adenine", "property": "toRna", "dna": "T", "expected": "A" }, { - "description": "rna complement of adenine is uracil", + "description": "RNA complement of adenine is uracil", "property": "toRna", "dna": "A", "expected": "U" }, { - "description": "rna complement", + "description": "RNA complement", "property": "toRna", "dna": "ACGTGGTCTTAA", "expected": "UGCACCAGAAUU" }, { - "description": "dna correctly handles invalid input", + "description": "correctly handles invalid input (RNA instead of DNA)", "property": "toRna", "dna": "U", "expected": null }, { - "description": "dna correctly handles completely invalid input", + "description": "correctly handles completely invalid DNA input", "property": "toRna", "dna": "XXX", "expected": null }, { - "description": "dna correctly handles partially invalid input", + "description": "correctly handles partially invalid DNA input", "property": "toRna", "dna": "ACGTXXXCTTAA", "expected": null } ]