Sha256: 8d24333630b23183c6bb2ff2acb438185c79a12b0bc7513f1f9a8fb27c988df4
Contents?: true
Size: 1.68 KB
Versions: 78
Compression:
Stored size: 1.68 KB
Contents
#!/usr/bin/env perl6 use v6; use Test; use JSON::Fast; use lib $?FILE.IO.dirname; use Acronym; plan 5; my Version:D $version = v2; if Acronym.^ver !~~ $version { warn "\nExercise version mismatch. Further tests may fail!" ~ "\nAcronym is {Acronym.^ver.gist}. " ~ "Test is {$version.gist}.\n"; } my $c-data = from-json $=pod.pop.contents; for $c-data<cases>»<cases>».Array.flat { is abbreviate(.<input><phrase>), |.<expected description>; } =head2 Canonical Data =begin code { "exercise": "acronym", "version": "1.3.0", "cases": [ { "description": "Abbreviate a phrase", "cases": [ { "description": "basic", "property": "abbreviate", "input": { "phrase": "Portable Network Graphics" }, "expected": "PNG" }, { "description": "lowercase words", "property": "abbreviate", "input": { "phrase": "Ruby on Rails" }, "expected": "ROR" }, { "description": "punctuation", "property": "abbreviate", "input": { "phrase": "First In, First Out" }, "expected": "FIFO" }, { "description": "all caps word", "property": "abbreviate", "input": { "phrase": "GNU Image Manipulation Program" }, "expected": "GIMP" }, { "description": "punctuation without whitespace", "property": "abbreviate", "input": { "phrase": "Complementary metal-oxide semiconductor" }, "expected": "CMOS" } ] } ] } =end code
Version data entries
78 entries across 78 versions & 1 rubygems