Sha256: fd5278f2fba900a5b5fedc5d2db400a812f21da817c185b53d195729918eda0e
Contents?: true
Size: 1.2 KB
Versions: 25
Compression:
Stored size: 1.2 KB
Contents
#!/usr/bin/env perl6 use v6; use Test; use lib IO::Path.new($?FILE).parent.path; BEGIN { plan 11; eval-lives-ok %*ENV<EXERCISM>.so ?? 'use Example' !! 'use Anagram', 'Module loaded'; } ok Anagram.can('match'), 'Class Anagram has match method'; is-deeply Anagram.match('diaper', ['hello', 'world', 'zombies', 'pants']), [], 'no matches'; is-deeply Anagram.match('ant', ['tan', 'stand', 'at']), ['tan'], 'detect simple anagram'; is-deeply Anagram.match('master', ['stream', 'pigeon', 'maters']), ['stream', 'maters'], 'multiple anagrams'; is-deeply Anagram.match('galea', ['eagle']), [], 'does not confuse different duplicates'; is-deeply Anagram.match('good', ['dog', 'goody']), [], 'eleminates anagram subsets'; is-deeply Anagram.match('listen', ['enlists', 'google', 'inlets', 'banana']), ['inlets'], 'detect anagram'; is-deeply Anagram.match('allergy', ['gallery', 'ballerina', 'regally', 'clergy', 'largely', 'leading']), ['gallery', 'regally', 'largely'], 'multiple anagrams'; is-deeply Anagram.match('Orchestra', ['cashregister', 'Carthorse', 'radishes']), ['Carthorse'], 'anagrams are case-insensitive'; is-deeply Anagram.match('banana', ['banana', 'Banana']), [], 'same word is not an anagram, whatever the case';
Version data entries
25 entries across 25 versions & 1 rubygems