@@ -2,75 +2,75 @@ if !System.get_env("EXERCISM_TEST_EXAMPLES") do
2
2
Code . load_file ( "anagram.exs" , __DIR__ )
3
3
end
4
4
5
- ExUnit . start
6
- ExUnit . configure exclude: :pending , trace: true
5
+ ExUnit . start ( )
6
+ ExUnit . configure ( exclude: :pending , trace: true )
7
7
8
8
defmodule AnagramTest do
9
9
use ExUnit.Case
10
10
11
11
# @tag :pending
12
12
test "no matches" do
13
- matches = Anagram . match "diaper" , [ "hello" , "world" , "zombies" , "pants" ]
13
+ matches = Anagram . match ( "diaper" , [ "hello" , "world" , "zombies" , "pants" ] )
14
14
assert matches == [ ]
15
15
end
16
16
17
17
@ tag :pending
18
18
test "detect simple anagram" do
19
- matches = Anagram . match "ant" , [ "tan" , "stand" , "at" ]
19
+ matches = Anagram . match ( "ant" , [ "tan" , "stand" , "at" ] )
20
20
assert matches == [ "tan" ]
21
21
end
22
22
23
23
@ tag :pending
24
24
test "detect multiple anagrams" do
25
- matches = Anagram . match "master" , [ "stream" , "pigeon" , "maters" ]
25
+ matches = Anagram . match ( "master" , [ "stream" , "pigeon" , "maters" ] )
26
26
assert matches == [ "stream" , "maters" ]
27
27
end
28
28
29
29
@ tag :pending
30
30
test "do not detect anagram subsets" do
31
- matches = Anagram . match "good" , ~w( dog goody)
31
+ matches = Anagram . match ( "good" , ~w( dog goody) )
32
32
assert matches == [ ]
33
33
end
34
34
35
35
@ tag :pending
36
36
test "detect anagram" do
37
- matches = Anagram . match "listen" , ~w( enlists google inlets banana)
37
+ matches = Anagram . match ( "listen" , ~w( enlists google inlets banana) )
38
38
assert matches == [ "inlets" ]
39
39
end
40
40
41
41
@ tag :pending
42
42
test "multiple anagrams" do
43
- matches = Anagram . match "allergy" , ~w( gallery ballerina regally clergy largely leading)
43
+ matches = Anagram . match ( "allergy" , ~w( gallery ballerina regally clergy largely leading) )
44
44
assert matches == [ "gallery" , "regally" , "largely" ]
45
45
end
46
46
47
47
@ tag :pending
48
48
test "anagrams must use all letters exactly once" do
49
- matches = Anagram . match "patter" , [ "tapper" ]
49
+ matches = Anagram . match ( "patter" , [ "tapper" ] )
50
50
assert matches == [ ]
51
51
end
52
52
53
53
@ tag :pending
54
54
test "detect anagrams with case-insensitive subject" do
55
- matches = Anagram . match "Orchestra" , ~w( cashregister carthorse radishes)
55
+ matches = Anagram . match ( "Orchestra" , ~w( cashregister carthorse radishes) )
56
56
assert matches == [ "carthorse" ]
57
57
end
58
58
59
59
@ tag :pending
60
60
test "detect anagrams with case-insensitive candidate" do
61
- matches = Anagram . match "orchestra" , ~w( cashregister Carthorse radishes)
61
+ matches = Anagram . match ( "orchestra" , ~w( cashregister Carthorse radishes) )
62
62
assert matches == [ "Carthorse" ]
63
63
end
64
64
65
65
@ tag :pending
66
66
test "anagrams must not be the source word" do
67
- matches = Anagram . match "corn" , [ "corn" , "dark" , "Corn" , "rank" , "CORN" , "cron" , "park" ]
67
+ matches = Anagram . match ( "corn" , [ "corn" , "dark" , "Corn" , "rank" , "CORN" , "cron" , "park" ] )
68
68
assert matches == [ "cron" ]
69
69
end
70
70
71
71
@ tag :pending
72
72
test "do not detect words based on checksum" do
73
- matches = Anagram . match "mass" , [ "last" ]
73
+ matches = Anagram . match ( "mass" , [ "last" ] )
74
74
assert matches == [ ]
75
75
end
76
76
end
0 commit comments