This repository was archived by the owner on Mar 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathanagram.vader
More file actions
75 lines (63 loc) · 2.5 KB
/
Copy pathanagram.vader
File metadata and controls
75 lines (63 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
"
" Version: 1.4.0
"
Execute (no matches):
let candidates = ['hello', 'world', 'zombies', 'pants']
let subject = "diaper"
let expected = []
AssertEqual expected, FindAnagrams(candidates, subject)
Execute (detects two anagrams):
let candidates = ['stream', 'pigeon', 'maters']
let subject = "master"
let expected = ['stream', 'maters']
AssertEqual expected, FindAnagrams(candidates, subject)
Execute (does not detect anagram subsets):
let candidates = ['dog', 'goody']
let subject = "good"
let expected = []
AssertEqual expected, FindAnagrams(candidates, subject)
Execute (detects anagram):
let candidates = ['enlists', 'google', 'inlets', 'banana']
let subject = "listen"
let expected = ['inlets']
AssertEqual expected, FindAnagrams(candidates, subject)
Execute (detects three anagrams):
let candidates = ['gallery', 'ballerina', 'regally', 'clergy', 'largely', 'leading']
let subject = "allergy"
let expected = ['gallery', 'regally', 'largely']
AssertEqual expected, FindAnagrams(candidates, subject)
Execute (does not detect non-anagrams with identical checksum):
let candidates = ['last']
let subject = "mass"
let expected = []
AssertEqual expected, FindAnagrams(candidates, subject)
Execute (detects anagrams case-insensitively):
let candidates = ['cashregister', 'Carthorse', 'radishes']
let subject = "Orchestra"
let expected = ['Carthorse']
AssertEqual expected, FindAnagrams(candidates, subject)
Execute (detects anagrams using case-insensitive subject):
let candidates = ['cashregister', 'carthorse', 'radishes']
let subject = "Orchestra"
let expected = ['carthorse']
AssertEqual expected, FindAnagrams(candidates, subject)
Execute (detects anagrams using case-insensitive possible matches):
let candidates = ['cashregister', 'Carthorse', 'radishes']
let subject = "orchestra"
let expected = ['Carthorse']
AssertEqual expected, FindAnagrams(candidates, subject)
Execute (does not detect a anagram if the original word is repeated):
let candidates = ['go Go GO']
let subject = "go"
let expected = []
AssertEqual expected, FindAnagrams(candidates, subject)
Execute (anagrams must use all letters exactly once):
let candidates = ['patter']
let subject = "tapper"
let expected = []
AssertEqual expected, FindAnagrams(candidates, subject)
Execute (words are not anagrams of themselves (case-insensitive)):
let candidates = ['BANANA', 'Banana', 'banana']
let subject = "BANANA"
let expected = []
AssertEqual expected, FindAnagrams(candidates, subject)