trackler 2.0.8.28 → 2.0.8.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/common/CONTRIBUTING.md +4 -1
  3. data/common/README.md +52 -0
  4. data/lib/trackler/version.rb +1 -1
  5. data/tracks/ecmascript/config.json +7 -0
  6. data/tracks/ecmascript/exercises/perfect-numbers/example.js +68 -0
  7. data/tracks/ecmascript/exercises/perfect-numbers/gulpfile.js +89 -0
  8. data/tracks/ecmascript/exercises/perfect-numbers/package.json +28 -0
  9. data/tracks/ecmascript/exercises/perfect-numbers/perfect-numbers.spec.js +75 -0
  10. data/tracks/erlang/exercises/accumulate/src/accumulate.app.src +1 -1
  11. data/tracks/erlang/exercises/all-your-base/src/all_your_base.app.src +1 -1
  12. data/tracks/erlang/exercises/allergies/src/allergies.app.src +1 -1
  13. data/tracks/erlang/exercises/anagram/src/anagram.app.src +1 -1
  14. data/tracks/erlang/exercises/atbash-cipher/src/atbash_cipher.app.src +1 -1
  15. data/tracks/erlang/exercises/bank-account/src/bank_account.app.src +1 -1
  16. data/tracks/erlang/exercises/beer-song/src/beer_song.app.src +1 -1
  17. data/tracks/erlang/exercises/bob/src/bob.app.src +1 -1
  18. data/tracks/erlang/exercises/circular-buffer/src/circular_buffer.app.src +1 -1
  19. data/tracks/erlang/exercises/clock/src/clock.app.src +1 -1
  20. data/tracks/erlang/exercises/difference-of-squares/src/difference_of_squares.app.src +1 -1
  21. data/tracks/erlang/exercises/etl/src/etl.app.src +1 -1
  22. data/tracks/erlang/exercises/gigasecond/src/gigasecond.app.src +1 -1
  23. data/tracks/erlang/exercises/grade-school/src/grade_school.app.src +1 -1
  24. data/tracks/erlang/exercises/grains/src/grains.app.src +1 -1
  25. data/tracks/erlang/exercises/hamming/src/hamming.app.src +1 -1
  26. data/tracks/erlang/exercises/hello-world/src/hello_world.app.src +1 -1
  27. data/tracks/erlang/exercises/largest-series-product/src/largest_series_product.app.src +1 -1
  28. data/tracks/erlang/exercises/leap/src/leap.app.src +1 -1
  29. data/tracks/erlang/exercises/luhn/src/luhn.app.src +1 -1
  30. data/tracks/erlang/exercises/meetup/src/meetup.app.src +1 -1
  31. data/tracks/erlang/exercises/nucleotide-count/src/nucleotide_count.app.src +1 -1
  32. data/tracks/erlang/exercises/parallel-letter-frequency/src/parallel_letter_frequency.app.src +1 -1
  33. data/tracks/erlang/exercises/phone-number/src/phone_number.app.src +1 -1
  34. data/tracks/erlang/exercises/rna-transcription/src/rna_transcription.app.src +1 -1
  35. data/tracks/erlang/exercises/robot-simulator/src/robot_simulator.app.src +1 -1
  36. data/tracks/erlang/exercises/roman-numerals/src/roman_numerals.app.src +1 -1
  37. data/tracks/erlang/exercises/rotational-cipher/src/rotational_cipher.app.src +1 -1
  38. data/tracks/erlang/exercises/scrabble-score/src/scrabble_score.app.src +1 -1
  39. data/tracks/erlang/exercises/series/src/series.app.src +1 -1
  40. data/tracks/erlang/exercises/space-age/src/space_age.app.src +1 -1
  41. data/tracks/erlang/exercises/strain/src/strain.app.src +1 -1
  42. data/tracks/erlang/exercises/sum-of-multiples/src/sum_of_multiples.app.src +1 -1
  43. data/tracks/erlang/exercises/triangle/src/triangle.app.src +1 -1
  44. data/tracks/erlang/exercises/word-count/src/word_count.app.src +1 -1
  45. data/tracks/erlang/exercises/zipper/src/zipper.app.src +1 -1
  46. data/tracks/go/exercises/hello-world/hello_world.go +10 -1
  47. data/tracks/haskell/exercises/simple-linked-list/examples/success-standard/package.yaml +1 -0
  48. data/tracks/haskell/exercises/simple-linked-list/examples/success-standard/src/LinkedList.hs +1 -0
  49. data/tracks/haskell/exercises/simple-linked-list/package.yaml +1 -0
  50. data/tracks/haskell/exercises/simple-linked-list/src/LinkedList.hs +1 -1
  51. data/tracks/haskell/exercises/simple-linked-list/test/Tests.hs +37 -1
  52. data/tracks/java/exercises/diamond/src/test/java/DiamondPrinterTest.java +13 -6
  53. data/tracks/java/exercises/secret-handshake/src/test/java/HandshakeCalculatorTest.java +21 -13
  54. data/tracks/objective-c/exercises/atbash-cipher/AtbashCipherExample.m +1 -1
  55. data/tracks/objective-c/exercises/beer-song/BeerSongExample.m +1 -1
  56. data/tracks/objective-c/exercises/beer-song/BeerSongTest.m +4 -4
  57. data/tracks/objective-c/exercises/binary-search/BinarySearchExample.m +1 -1
  58. data/tracks/objective-c/exercises/flatten-array/FlattenArrayExample.h +2 -1
  59. data/tracks/objective-c/exercises/flatten-array/FlattenArrayExample.m +12 -25
  60. data/tracks/objective-c/exercises/flatten-array/FlattenArrayTest.m +32 -80
  61. data/tracks/objective-c/exercises/sublist/SublistTest.m +47 -70
  62. data/tracks/perl6/exercises/allergies/Allergies.pm6 +1 -0
  63. data/tracks/perl6/exercises/allergies/Example.pm +3 -1
  64. data/tracks/perl6/exercises/allergies/allergies.t +187 -137
  65. data/tracks/perl6/exercises/anagram/Anagram.pm6 +1 -0
  66. data/tracks/perl6/exercises/anagram/Example.pm +15 -15
  67. data/tracks/perl6/exercises/anagram/anagram.t +164 -15
  68. data/tracks/perl6/exercises/atbash-cipher/AtbashCipher.pm6 +1 -0
  69. data/tracks/perl6/exercises/atbash-cipher/Example.pm +2 -0
  70. data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +109 -86
  71. data/tracks/perl6/exercises/grains/Example.pm +10 -9
  72. data/tracks/perl6/exercises/grains/Grains.pm6 +1 -0
  73. data/tracks/perl6/exercises/grains/grains.t +126 -18
  74. data/tracks/perl6/exercises/leap/Example.pm +9 -9
  75. data/tracks/perl6/exercises/leap/Leap.pm6 +4 -0
  76. data/tracks/perl6/exercises/leap/leap.t +61 -17
  77. data/tracks/perl6/exercises/phone-number/Example.pm +4 -28
  78. data/tracks/perl6/exercises/phone-number/PhoneNumber.pm6 +4 -0
  79. data/tracks/perl6/exercises/phone-number/phone-number.t +102 -65
  80. data/tracks/perl6/exercises/raindrops/Example.pm +10 -8
  81. data/tracks/perl6/exercises/raindrops/Raindrops.pm6 +4 -0
  82. data/tracks/perl6/exercises/raindrops/raindrops.t +153 -20
  83. data/tracks/perl6/exercises/rna-transcription/Example.pm +5 -7
  84. data/tracks/perl6/exercises/rna-transcription/RNA.pm6 +4 -0
  85. data/tracks/perl6/exercises/rna-transcription/rna-transcription.t +107 -11
  86. data/tracks/perl6/exercises/scrabble-score/Example.pm +14 -19
  87. data/tracks/perl6/exercises/scrabble-score/Scrabble.pm6 +4 -0
  88. data/tracks/perl6/exercises/scrabble-score/scrabble-score.t +106 -15
  89. data/tracks/perl6/exercises/space-age/Example.pm +29 -13
  90. data/tracks/perl6/exercises/space-age/SpaceAge.pm6 +22 -0
  91. data/tracks/perl6/exercises/space-age/space-age.t +90 -52
  92. data/tracks/perl6/exercises/word-count/Example.pm +4 -8
  93. data/tracks/perl6/exercises/word-count/WordCount.pm6 +4 -0
  94. data/tracks/perl6/exercises/word-count/word-count.t +149 -16
  95. data/tracks/perl6/exercises/wordy/Example.pm +13 -13
  96. data/tracks/perl6/exercises/wordy/Wordy.pm6 +4 -0
  97. data/tracks/perl6/exercises/wordy/wordy.t +140 -97
  98. data/tracks/purescript/config.json +7 -0
  99. data/tracks/purescript/exercises/atbash-cipher/bower.json +18 -0
  100. data/tracks/purescript/exercises/atbash-cipher/examples/src/AtbashCipher.purs +41 -0
  101. data/tracks/purescript/exercises/atbash-cipher/src/AtbashCipher.purs +4 -0
  102. data/tracks/purescript/exercises/atbash-cipher/test/Main.purs +64 -0
  103. data/tracks/python/exercises/run-length-encoding/run_length_encoding_test.py +2 -0
  104. data/tracks/swift/exercises/grade-school/Tests/GradeSchoolTests/GradeSchoolTests.swift +1 -1
  105. metadata +22 -2
@@ -1,155 +1,205 @@
1
1
  #!/usr/bin/env perl6
2
-
2
+ use v6;
3
3
  use Test;
4
+ use lib my $dir = $?FILE.IO.dirname;
4
5
  use JSON::Tiny;
5
6
 
6
- use lib $?FILE.IO.dirname;
7
-
8
- my $module = %*ENV<EXERCISM> ?? 'Example' !! 'Allergies';
9
- require ::($module) <&allergic-to &list-allergies>;
7
+ my $exercise = 'Allergies';
8
+ my $version = v1;
9
+ my $module = %*ENV<EXERCISM> ?? 'Example' !! $exercise;
10
+ plan 5;
10
11
 
11
- plan 2;
12
-
13
- my %cases;
14
- subtest 'allergic-to' => {
15
- my @cases = |%cases{'allergic_to'}{'cases'};
12
+ use-ok $module or bail-out;
13
+ require ::($module);
14
+ if ::($exercise).^ver !~~ $version {
15
+ warn "\nExercise version mismatch. Further tests may fail!"
16
+ ~ "\n$exercise is $(::($exercise).^ver.gist). "
17
+ ~ "Test is $($version.gist).\n";
18
+ bail-out 'Example version must match test version.' if %*ENV<EXERCISM>;
19
+ }
16
20
 
17
- plan +@cases;
21
+ my @subs;
22
+ BEGIN { @subs = <&allergic-to &list-allergies> };
23
+ subtest 'Subroutine(s)', {
24
+ plan 2;
25
+ eval-lives-ok "use $module; ::('$_').defined or die '$_ is not defined.'", $_ for @subs;
26
+ } or bail-out 'All subroutines must be defined and exported.';
27
+ require ::($module) @subs.eager;
18
28
 
19
- for |@cases -> %case {
20
- subtest %case.<description> => {
21
- plan +|%case.<expected>;
22
- for |%case.<expected> -> %expected {
23
- is allergic-to(%case.<score>,%expected.<substance>), %expected.<result>
24
- or diag %expected;
25
- }
26
- }
29
+ for @(my $c-data.<cases>) -> %cases {
30
+ subtest 'allergic-to' => {
31
+ plan 7;
32
+ my @cases = |%cases<cases>;
33
+ for @cases -> %case {
34
+ is allergic-to(%case<score>, .<substance>), .<result>, %case<description> for @(%case<expected>);
27
35
  }
28
- };
29
-
30
- subtest 'list' => {
31
- my @cases = |%cases{'list'}{'cases'};
36
+ } if %cases<description> ~~ 'allergicTo';
32
37
 
33
- plan +@cases;
34
-
35
- for |@cases {
36
- is list-allergies(.<score>), .<expected>, .<description>
37
- or diag $_;
38
+ subtest 'list-allergies' => {
39
+ plan 9;
40
+ my @cases = |%cases<cases>;
41
+ for @cases {
42
+ is list-allergies(.<score>), |.<expected description>;
38
43
  }
39
- };
44
+ } if %cases<description> ~~ 'list';
45
+ }
46
+
47
+ if %*ENV<EXERCISM> && (my $c-data-file = "$dir/../../x-common/exercises/{$dir.IO.basename}/canonical-data.json".IO.resolve) ~~ :f {
48
+ is-deeply $c-data, from-json($c-data-file.slurp), 'canonical-data'
49
+ } else { skip }
40
50
 
41
51
  done-testing;
42
52
 
43
53
  INIT {
44
- %cases := from-json 「
54
+ $c-data := from-json 「
45
55
  {
46
- "allergic_to": {
47
- "description": [
48
- "Given a number and a substance, indicate whether Tom is allergic ",
49
- "to that substance.",
50
- "Test cases for this method involve more than one assertion.",
51
- "Each case in 'expected' specifies what the method should return for",
52
- "the given substance."
53
- ],
54
- "cases": [
55
- {
56
- "description": "no allergies means not allergic",
57
- "score": 0,
58
- "expected": [
59
- {
60
- "substance": "peanuts",
61
- "result": false
62
- },
63
- {
64
- "substance": "cats",
65
- "result": false
66
- },
67
- {
68
- "substance": "strawberries",
69
- "result": false
70
- }
71
- ]
72
- },
73
- {
74
- "description": "is allergic to eggs",
75
- "score": 1,
76
- "expected": [
77
- {
78
- "substance": "eggs",
79
- "result": true
80
- }
81
- ]
82
- },
83
- {
84
- "description": "allergic to eggs in addition to other stuff",
85
- "score": 5,
86
- "expected": [
87
- {
88
- "substance": "eggs",
89
- "result": true
90
- },
91
- {
92
- "substance": "shellfish",
93
- "result": true
94
- },
95
- {
96
- "substance": "strawberries",
97
- "result": false
98
- }
99
- ]
100
- }
101
- ]
102
- },
103
- "list": {
104
- "description": ["Given a number, list all things Tom is allergic to"],
105
- "cases": [
106
- {
107
- "description": "no allergies at all",
108
- "score": 0,
109
- "expected": []
110
- },
111
- {
112
- "description": "allergic to just eggs",
113
- "score": 1,
114
- "expected": ["eggs"]
115
- },
116
- {
117
- "description": "allergic to just peanuts",
118
- "score": 2,
119
- "expected": ["peanuts"]
120
- },
121
- {
122
- "description": "allergic to just strawberries",
123
- "score": 8,
124
- "expected": ["strawberries"]
125
- },
126
- {
127
- "description": "allergic to eggs and peanuts",
128
- "score": 3,
129
- "expected": ["eggs", "peanuts"]
130
- },
131
- {
132
- "description": "allergic to more than eggs but not peanuts",
133
- "score": 5,
134
- "expected": ["eggs", "shellfish"]
135
- },
136
- {
137
- "description": "allergic to lots of stuff",
138
- "score": 248,
139
- "expected": ["strawberries", "tomatoes", "chocolate", "pollen", "cats"]
140
- },
141
- {
142
- "description": "allergic to everything",
143
- "score": 255,
144
- "expected": ["eggs", "peanuts", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"]
145
- },
146
- {
147
- "description": "ignore non allergen score parts",
148
- "score": 509,
149
- "expected": ["eggs", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"]
150
- }
151
- ]
152
- }
56
+ "exercise": "allergies",
57
+ "version": "1.0.0",
58
+ "cases": [
59
+ {
60
+ "description": "allergicTo",
61
+ "comments": [
62
+ "Given a number and a substance, indicate whether Tom is allergic ",
63
+ "to that substance.",
64
+ "Test cases for this method involve more than one assertion.",
65
+ "Each case in 'expected' specifies what the method should return for",
66
+ "the given substance."
67
+ ],
68
+ "cases": [
69
+ {
70
+ "description": "no allergies means not allergic",
71
+ "property": "allergicTo",
72
+ "score": 0,
73
+ "expected": [
74
+ {
75
+ "substance": "peanuts",
76
+ "result": false
77
+ },
78
+ {
79
+ "substance": "cats",
80
+ "result": false
81
+ },
82
+ {
83
+ "substance": "strawberries",
84
+ "result": false
85
+ }
86
+ ]
87
+ },
88
+ {
89
+ "description": "is allergic to eggs",
90
+ "property": "allergicTo",
91
+ "score": 1,
92
+ "expected": [
93
+ {
94
+ "substance": "eggs",
95
+ "result": true
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "description": "allergic to eggs in addition to other stuff",
101
+ "property": "allergicTo",
102
+ "score": 5,
103
+ "expected": [
104
+ {
105
+ "substance": "eggs",
106
+ "result": true
107
+ },
108
+ {
109
+ "substance": "shellfish",
110
+ "result": true
111
+ },
112
+ {
113
+ "substance": "strawberries",
114
+ "result": false
115
+ }
116
+ ]
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ "description": "list",
122
+ "comments": [
123
+ "Given a number, list all things Tom is allergic to"
124
+ ],
125
+ "cases": [
126
+ {
127
+ "description": "no allergies at all",
128
+ "property": "list",
129
+ "score": 0,
130
+ "expected": []
131
+ },
132
+ {
133
+ "description": "allergic to just eggs",
134
+ "property": "list",
135
+ "score": 1,
136
+ "expected": ["eggs"]
137
+ },
138
+ {
139
+ "description": "allergic to just peanuts",
140
+ "property": "list",
141
+ "score": 2,
142
+ "expected": ["peanuts"]
143
+ },
144
+ {
145
+ "description": "allergic to just strawberries",
146
+ "property": "list",
147
+ "score": 8,
148
+ "expected": ["strawberries"]
149
+ },
150
+ {
151
+ "description": "allergic to eggs and peanuts",
152
+ "property": "list",
153
+ "score": 3,
154
+ "expected": ["eggs", "peanuts"]
155
+ },
156
+ {
157
+ "description": "allergic to more than eggs but not peanuts",
158
+ "property": "list",
159
+ "score": 5,
160
+ "expected": ["eggs", "shellfish"]
161
+ },
162
+ {
163
+ "description": "allergic to lots of stuff",
164
+ "property": "list",
165
+ "score": 248,
166
+ "expected": [ "strawberries",
167
+ "tomatoes",
168
+ "chocolate",
169
+ "pollen",
170
+ "cats"
171
+ ]
172
+ },
173
+ {
174
+ "description": "allergic to everything",
175
+ "property": "list",
176
+ "score": 255,
177
+ "expected": [ "eggs",
178
+ "peanuts",
179
+ "shellfish",
180
+ "strawberries",
181
+ "tomatoes",
182
+ "chocolate",
183
+ "pollen",
184
+ "cats"
185
+ ]
186
+ },
187
+ {
188
+ "description": "ignore non allergen score parts",
189
+ "property": "list",
190
+ "score": 509,
191
+ "expected": [ "eggs",
192
+ "shellfish",
193
+ "strawberries",
194
+ "tomatoes",
195
+ "chocolate",
196
+ "pollen",
197
+ "cats"
198
+ ]
199
+ }
200
+ ]
201
+ }
202
+ ]
153
203
  }
154
204
 
155
205
  }
@@ -0,0 +1 @@
1
+ unit module Anagram:ver<1>;
@@ -1,18 +1,18 @@
1
- class Anagram is export {
2
- method match ($word, @words) {
3
- my @results;
4
- my $canonical = self!canonize($word);
5
- for @words -> $w {
6
- next if $w.lc eq $word.lc;
7
- my $try = self!canonize($w);
8
- if $try eq $canonical {
9
- @results.push: $w;
10
- }
11
- }
12
- @results;
13
- }
1
+ unit module Anagram:ver<1>;
14
2
 
15
- method !canonize($str) {
16
- (($str.lc.split('')).sort).join('');
3
+ sub match-anagrams ($word, @words) is export {
4
+ my @results;
5
+ my $canonical = canonize($word);
6
+ for @words -> $w {
7
+ next if $w.lc eq $word.lc;
8
+ my $try = canonize($w);
9
+ if $try eq $canonical {
10
+ @results.push: $w;
17
11
  }
12
+ }
13
+ @results;
14
+ }
15
+
16
+ sub canonize ($str) {
17
+ (($str.lc.split('')).sort).join('');
18
18
  }
@@ -1,21 +1,170 @@
1
1
  #!/usr/bin/env perl6
2
2
  use v6;
3
3
  use Test;
4
- use lib IO::Path.new($?FILE).parent.path;
4
+ use lib my $dir = $?FILE.IO.dirname;
5
+ use JSON::Tiny;
5
6
 
6
- plan 11;
7
- my $module = %*ENV<EXERCISM> ?? 'Example' !! 'Anagram';
8
- use-ok $module;
9
- require ::($module) <Anagram>;
7
+ my $exercise = 'Anagram';
8
+ my $version = v1;
9
+ my $module = %*ENV<EXERCISM> ?? 'Example' !! $exercise;
10
+ plan 19;
10
11
 
11
- ok Anagram.can('match'), 'Class Anagram has match method';
12
+ use-ok $module or bail-out;
13
+ require ::($module);
14
+ if ::($exercise).^ver !~~ $version {
15
+ warn "\nExercise version mismatch. Further tests may fail!"
16
+ ~ "\n$exercise is $(::($exercise).^ver.gist). "
17
+ ~ "Test is $($version.gist).\n";
18
+ bail-out 'Example version must match test version.' if %*ENV<EXERCISM>;
19
+ }
12
20
 
13
- is-deeply Anagram.match('diaper', ['hello', 'world', 'zombies', 'pants']), [], 'no matches';
14
- is-deeply Anagram.match('ant', ['tan', 'stand', 'at']), ['tan'], 'detect simple anagram';
15
- is-deeply Anagram.match('master', ['stream', 'pigeon', 'maters']), ['stream', 'maters'], 'multiple anagrams';
16
- is-deeply Anagram.match('galea', ['eagle']), [], 'does not confuse different duplicates';
17
- is-deeply Anagram.match('good', ['dog', 'goody']), [], 'eleminates anagram subsets';
18
- is-deeply Anagram.match('listen', ['enlists', 'google', 'inlets', 'banana']), ['inlets'], 'detect anagram';
19
- is-deeply Anagram.match('allergy', ['gallery', 'ballerina', 'regally', 'clergy', 'largely', 'leading']), ['gallery', 'regally', 'largely'], 'multiple anagrams';
20
- is-deeply Anagram.match('Orchestra', ['cashregister', 'Carthorse', 'radishes']), ['Carthorse'], 'anagrams are case-insensitive';
21
- is-deeply Anagram.match('banana', ['banana', 'Banana']), [], 'same word is not an anagram, whatever the case';
21
+ my @subs;
22
+ BEGIN { @subs = <&match-anagrams> };
23
+ subtest 'Subroutine(s)', {
24
+ plan 1;
25
+ eval-lives-ok "use $module; ::('$_').defined or die '$_ is not defined.'", $_ for @subs;
26
+ } or bail-out 'All subroutines must be defined and exported.';
27
+ require ::($module) @subs.eager;
28
+
29
+ is match-anagrams(|.<subject candidates>), |.<expected description> for @(my $c-data.<cases>);
30
+
31
+ if %*ENV<EXERCISM> && (my $c-data-file = "$dir/../../x-common/exercises/{$dir.IO.basename}/canonical-data.json".IO.resolve) ~~ :f {
32
+ is-deeply $c-data, from-json($c-data-file.slurp), 'canonical-data'
33
+ } else { skip }
34
+
35
+ done-testing;
36
+
37
+ INIT {
38
+ $c-data := from-json 「
39
+ {
40
+ "exercise": "anagram",
41
+ "version": "1.0.1",
42
+ "comments": [
43
+ "The string argument cases possible matches are passed in as",
44
+ "individual arguments rather than arrays. Languages can include",
45
+ "these string argument cases if passing individual arguments is",
46
+ "idiomatic in that language."
47
+ ],
48
+ "cases": [
49
+ {
50
+ "description": "no matches",
51
+ "property": "anagrams",
52
+ "subject": "diaper",
53
+ "candidates": ["hello", "world", "zombies", "pants"],
54
+ "expected": []
55
+ },
56
+ {
57
+ "description": "detects simple anagram",
58
+ "property": "anagrams",
59
+ "subject": "ant",
60
+ "candidates": ["tan", "stand", "at"],
61
+ "expected": ["tan"]
62
+ },
63
+ {
64
+ "description": "does not detect false positives",
65
+ "property": "anagrams",
66
+ "subject": "galea",
67
+ "candidates": ["eagle"],
68
+ "expected": []
69
+ },
70
+ {
71
+ "description": "detects two anagrams",
72
+ "property": "anagrams",
73
+ "subject": "master",
74
+ "candidates": ["stream", "pigeon", "maters"],
75
+ "expected": ["stream", "maters"]
76
+ },
77
+ {
78
+ "description": "does not detect anagram subsets",
79
+ "property": "anagrams",
80
+ "subject": "good",
81
+ "candidates": ["dog", "goody"],
82
+ "expected": []
83
+ },
84
+ {
85
+ "description": "detects anagram",
86
+ "property": "anagrams",
87
+ "subject": "listen",
88
+ "candidates": ["enlists", "google", "inlets", "banana"],
89
+ "expected": ["inlets"]
90
+ },
91
+ {
92
+ "description": "detects three anagrams",
93
+ "property": "anagrams",
94
+ "subject": "allergy",
95
+ "candidates": [ "gallery",
96
+ "ballerina",
97
+ "regally",
98
+ "clergy",
99
+ "largely",
100
+ "leading"
101
+ ],
102
+ "expected": ["gallery", "regally", "largely"]
103
+ },
104
+ {
105
+ "description": "does not detect identical words",
106
+ "property": "anagrams",
107
+ "subject": "corn",
108
+ "candidates": ["corn", "dark", "Corn", "rank", "CORN", "cron", "park"],
109
+ "expected": ["cron"]
110
+ },
111
+ {
112
+ "description": "does not detect non-anagrams with identical checksum",
113
+ "property": "anagrams",
114
+ "subject": "mass",
115
+ "candidates": ["last"],
116
+ "expected": []
117
+ },
118
+ {
119
+ "description": "detects anagrams case-insensitively",
120
+ "property": "anagrams",
121
+ "subject": "Orchestra",
122
+ "candidates": ["cashregister", "Carthorse", "radishes"],
123
+ "expected": ["Carthorse"]
124
+ },
125
+ {
126
+ "description": "detects anagrams using case-insensitive subject",
127
+ "property": "anagrams",
128
+ "subject": "Orchestra",
129
+ "candidates": ["cashregister", "carthorse", "radishes"],
130
+ "expected": ["carthorse"]
131
+ },
132
+ {
133
+ "description": "detects anagrams using case-insensitive possible matches",
134
+ "property": "anagrams",
135
+ "subject": "orchestra",
136
+ "candidates": ["cashregister", "Carthorse", "radishes"],
137
+ "expected": ["Carthorse"]
138
+ },
139
+ {
140
+ "description": "does not detect a word as its own anagram",
141
+ "property": "anagrams",
142
+ "subject": "banana",
143
+ "candidates": ["Banana"],
144
+ "expected": []
145
+ },
146
+ {
147
+ "description": "does not detect a anagram if the original word is repeated",
148
+ "property": "anagrams",
149
+ "subject": "go",
150
+ "candidates": ["go Go GO"],
151
+ "expected": []
152
+ },
153
+ {
154
+ "description": "anagrams must use all letters exactly once",
155
+ "property": "anagrams",
156
+ "subject": "tapper",
157
+ "candidates": ["patter"],
158
+ "expected": []
159
+ },
160
+ {
161
+ "description": "capital word is not own anagram",
162
+ "property": "anagrams",
163
+ "subject": "BANANA",
164
+ "candidates": ["Banana"],
165
+ "expected": []
166
+ }
167
+ ]
168
+ }
169
+
170
+ }