Sha256: d7e61ff813b4682465a9baf1a5ec48b10af37b4daad257723013c381aefdf4d4
Contents?: true
Size: 1.3 KB
Versions: 19
Compression:
Stored size: 1.3 KB
Contents
use v6; use Test; use lib './'; BEGIN { plan 11; my @files = <Example Anagram>; my $file = @files.grep({ ( $_ ~ '.pm' ).IO.f })[0] or exit flunk "neither " ~ ( @files.map({ $_ ~ '.pm' }).join( ' or ' ) ) ~ ' found'; EVAL( 'use ' ~ $file ); pass 'Load module'; } 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
19 entries across 19 versions & 1 rubygems