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.
- checksums.yaml +4 -4
- data/common/CONTRIBUTING.md +4 -1
- data/common/README.md +52 -0
- data/lib/trackler/version.rb +1 -1
- data/tracks/ecmascript/config.json +7 -0
- data/tracks/ecmascript/exercises/perfect-numbers/example.js +68 -0
- data/tracks/ecmascript/exercises/perfect-numbers/gulpfile.js +89 -0
- data/tracks/ecmascript/exercises/perfect-numbers/package.json +28 -0
- data/tracks/ecmascript/exercises/perfect-numbers/perfect-numbers.spec.js +75 -0
- data/tracks/erlang/exercises/accumulate/src/accumulate.app.src +1 -1
- data/tracks/erlang/exercises/all-your-base/src/all_your_base.app.src +1 -1
- data/tracks/erlang/exercises/allergies/src/allergies.app.src +1 -1
- data/tracks/erlang/exercises/anagram/src/anagram.app.src +1 -1
- data/tracks/erlang/exercises/atbash-cipher/src/atbash_cipher.app.src +1 -1
- data/tracks/erlang/exercises/bank-account/src/bank_account.app.src +1 -1
- data/tracks/erlang/exercises/beer-song/src/beer_song.app.src +1 -1
- data/tracks/erlang/exercises/bob/src/bob.app.src +1 -1
- data/tracks/erlang/exercises/circular-buffer/src/circular_buffer.app.src +1 -1
- data/tracks/erlang/exercises/clock/src/clock.app.src +1 -1
- data/tracks/erlang/exercises/difference-of-squares/src/difference_of_squares.app.src +1 -1
- data/tracks/erlang/exercises/etl/src/etl.app.src +1 -1
- data/tracks/erlang/exercises/gigasecond/src/gigasecond.app.src +1 -1
- data/tracks/erlang/exercises/grade-school/src/grade_school.app.src +1 -1
- data/tracks/erlang/exercises/grains/src/grains.app.src +1 -1
- data/tracks/erlang/exercises/hamming/src/hamming.app.src +1 -1
- data/tracks/erlang/exercises/hello-world/src/hello_world.app.src +1 -1
- data/tracks/erlang/exercises/largest-series-product/src/largest_series_product.app.src +1 -1
- data/tracks/erlang/exercises/leap/src/leap.app.src +1 -1
- data/tracks/erlang/exercises/luhn/src/luhn.app.src +1 -1
- data/tracks/erlang/exercises/meetup/src/meetup.app.src +1 -1
- data/tracks/erlang/exercises/nucleotide-count/src/nucleotide_count.app.src +1 -1
- data/tracks/erlang/exercises/parallel-letter-frequency/src/parallel_letter_frequency.app.src +1 -1
- data/tracks/erlang/exercises/phone-number/src/phone_number.app.src +1 -1
- data/tracks/erlang/exercises/rna-transcription/src/rna_transcription.app.src +1 -1
- data/tracks/erlang/exercises/robot-simulator/src/robot_simulator.app.src +1 -1
- data/tracks/erlang/exercises/roman-numerals/src/roman_numerals.app.src +1 -1
- data/tracks/erlang/exercises/rotational-cipher/src/rotational_cipher.app.src +1 -1
- data/tracks/erlang/exercises/scrabble-score/src/scrabble_score.app.src +1 -1
- data/tracks/erlang/exercises/series/src/series.app.src +1 -1
- data/tracks/erlang/exercises/space-age/src/space_age.app.src +1 -1
- data/tracks/erlang/exercises/strain/src/strain.app.src +1 -1
- data/tracks/erlang/exercises/sum-of-multiples/src/sum_of_multiples.app.src +1 -1
- data/tracks/erlang/exercises/triangle/src/triangle.app.src +1 -1
- data/tracks/erlang/exercises/word-count/src/word_count.app.src +1 -1
- data/tracks/erlang/exercises/zipper/src/zipper.app.src +1 -1
- data/tracks/go/exercises/hello-world/hello_world.go +10 -1
- data/tracks/haskell/exercises/simple-linked-list/examples/success-standard/package.yaml +1 -0
- data/tracks/haskell/exercises/simple-linked-list/examples/success-standard/src/LinkedList.hs +1 -0
- data/tracks/haskell/exercises/simple-linked-list/package.yaml +1 -0
- data/tracks/haskell/exercises/simple-linked-list/src/LinkedList.hs +1 -1
- data/tracks/haskell/exercises/simple-linked-list/test/Tests.hs +37 -1
- data/tracks/java/exercises/diamond/src/test/java/DiamondPrinterTest.java +13 -6
- data/tracks/java/exercises/secret-handshake/src/test/java/HandshakeCalculatorTest.java +21 -13
- data/tracks/objective-c/exercises/atbash-cipher/AtbashCipherExample.m +1 -1
- data/tracks/objective-c/exercises/beer-song/BeerSongExample.m +1 -1
- data/tracks/objective-c/exercises/beer-song/BeerSongTest.m +4 -4
- data/tracks/objective-c/exercises/binary-search/BinarySearchExample.m +1 -1
- data/tracks/objective-c/exercises/flatten-array/FlattenArrayExample.h +2 -1
- data/tracks/objective-c/exercises/flatten-array/FlattenArrayExample.m +12 -25
- data/tracks/objective-c/exercises/flatten-array/FlattenArrayTest.m +32 -80
- data/tracks/objective-c/exercises/sublist/SublistTest.m +47 -70
- data/tracks/perl6/exercises/allergies/Allergies.pm6 +1 -0
- data/tracks/perl6/exercises/allergies/Example.pm +3 -1
- data/tracks/perl6/exercises/allergies/allergies.t +187 -137
- data/tracks/perl6/exercises/anagram/Anagram.pm6 +1 -0
- data/tracks/perl6/exercises/anagram/Example.pm +15 -15
- data/tracks/perl6/exercises/anagram/anagram.t +164 -15
- data/tracks/perl6/exercises/atbash-cipher/AtbashCipher.pm6 +1 -0
- data/tracks/perl6/exercises/atbash-cipher/Example.pm +2 -0
- data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +109 -86
- data/tracks/perl6/exercises/grains/Example.pm +10 -9
- data/tracks/perl6/exercises/grains/Grains.pm6 +1 -0
- data/tracks/perl6/exercises/grains/grains.t +126 -18
- data/tracks/perl6/exercises/leap/Example.pm +9 -9
- data/tracks/perl6/exercises/leap/Leap.pm6 +4 -0
- data/tracks/perl6/exercises/leap/leap.t +61 -17
- data/tracks/perl6/exercises/phone-number/Example.pm +4 -28
- data/tracks/perl6/exercises/phone-number/PhoneNumber.pm6 +4 -0
- data/tracks/perl6/exercises/phone-number/phone-number.t +102 -65
- data/tracks/perl6/exercises/raindrops/Example.pm +10 -8
- data/tracks/perl6/exercises/raindrops/Raindrops.pm6 +4 -0
- data/tracks/perl6/exercises/raindrops/raindrops.t +153 -20
- data/tracks/perl6/exercises/rna-transcription/Example.pm +5 -7
- data/tracks/perl6/exercises/rna-transcription/RNA.pm6 +4 -0
- data/tracks/perl6/exercises/rna-transcription/rna-transcription.t +107 -11
- data/tracks/perl6/exercises/scrabble-score/Example.pm +14 -19
- data/tracks/perl6/exercises/scrabble-score/Scrabble.pm6 +4 -0
- data/tracks/perl6/exercises/scrabble-score/scrabble-score.t +106 -15
- data/tracks/perl6/exercises/space-age/Example.pm +29 -13
- data/tracks/perl6/exercises/space-age/SpaceAge.pm6 +22 -0
- data/tracks/perl6/exercises/space-age/space-age.t +90 -52
- data/tracks/perl6/exercises/word-count/Example.pm +4 -8
- data/tracks/perl6/exercises/word-count/WordCount.pm6 +4 -0
- data/tracks/perl6/exercises/word-count/word-count.t +149 -16
- data/tracks/perl6/exercises/wordy/Example.pm +13 -13
- data/tracks/perl6/exercises/wordy/Wordy.pm6 +4 -0
- data/tracks/perl6/exercises/wordy/wordy.t +140 -97
- data/tracks/purescript/config.json +7 -0
- data/tracks/purescript/exercises/atbash-cipher/bower.json +18 -0
- data/tracks/purescript/exercises/atbash-cipher/examples/src/AtbashCipher.purs +41 -0
- data/tracks/purescript/exercises/atbash-cipher/src/AtbashCipher.purs +4 -0
- data/tracks/purescript/exercises/atbash-cipher/test/Main.purs +64 -0
- data/tracks/python/exercises/run-length-encoding/run_length_encoding_test.py +2 -0
- data/tracks/swift/exercises/grade-school/Tests/GradeSchoolTests/GradeSchoolTests.swift +1 -1
- 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
|
-
|
7
|
-
|
8
|
-
my $module = %*ENV<EXERCISM> ?? 'Example' !!
|
9
|
-
|
7
|
+
my $exercise = 'Allergies';
|
8
|
+
my $version = v1;
|
9
|
+
my $module = %*ENV<EXERCISM> ?? 'Example' !! $exercise;
|
10
|
+
plan 5;
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
-
|
54
|
+
$c-data := from-json 「
|
45
55
|
{
|
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
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
"
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
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
|
-
|
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
|
-
|
16
|
-
|
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
|
4
|
+
use lib my $dir = $?FILE.IO.dirname;
|
5
|
+
use JSON::Tiny;
|
5
6
|
|
6
|
-
|
7
|
-
my $
|
8
|
-
|
9
|
-
|
7
|
+
my $exercise = 'Anagram';
|
8
|
+
my $version = v1;
|
9
|
+
my $module = %*ENV<EXERCISM> ?? 'Example' !! $exercise;
|
10
|
+
plan 19;
|
10
11
|
|
11
|
-
ok
|
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
is
|
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
|
+
}
|