trackler 2.2.1.49 → 2.2.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/verify-configs +1 -1
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/kindergarten-garden/canonical-data.json +0 -37
- data/tracks/c/exercises/allergies/test/test_allergies.c +41 -41
- data/tracks/common-lisp/config.json +266 -252
- data/tracks/common-lisp/config/maintainers.json +23 -23
- data/tracks/common-lisp/exercises/allergies/README.md +0 -1
- data/tracks/common-lisp/exercises/atbash-cipher/README.md +2 -1
- data/tracks/common-lisp/exercises/beer-song/README.md +1 -1
- data/tracks/common-lisp/exercises/binary/README.md +2 -0
- data/tracks/common-lisp/exercises/collatz-conjecture/README.md +4 -8
- data/tracks/common-lisp/exercises/crypto-square/README.md +4 -4
- data/tracks/common-lisp/exercises/etl/README.md +2 -0
- data/tracks/common-lisp/exercises/grade-school/README.md +0 -1
- data/tracks/common-lisp/exercises/grains/README.md +0 -1
- data/tracks/common-lisp/exercises/leap/README.md +1 -1
- data/tracks/common-lisp/exercises/meetup/README.md +1 -2
- data/tracks/common-lisp/exercises/nucleotide-count/README.md +8 -22
- data/tracks/common-lisp/exercises/pascals-triangle/README.md +1 -1
- data/tracks/common-lisp/exercises/perfect-numbers/README.md +3 -4
- data/tracks/common-lisp/exercises/phone-number/README.md +3 -2
- data/tracks/common-lisp/exercises/roman-numerals/README.md +1 -1
- data/tracks/common-lisp/exercises/scrabble-score/README.md +3 -1
- data/tracks/common-lisp/exercises/space-age/README.md +2 -1
- data/tracks/common-lisp/exercises/sublist/README.md +65 -0
- data/tracks/common-lisp/exercises/sublist/example.lisp +24 -0
- data/tracks/common-lisp/exercises/sublist/sublist-test.lisp +87 -0
- data/tracks/common-lisp/exercises/sublist/sublist.lisp +8 -0
- data/tracks/common-lisp/exercises/triangle/README.md +9 -6
- data/tracks/common-lisp/exercises/trinary/README.md +1 -1
- data/tracks/common-lisp/exercises/word-count/README.md +1 -2
- data/tracks/ecmascript/config.json +30 -0
- data/tracks/ecmascript/exercises/bowling/README.md +80 -0
- data/tracks/ecmascript/exercises/bowling/bowling.spec.js +159 -0
- data/tracks/ecmascript/exercises/bowling/example.js +67 -0
- data/tracks/ecmascript/exercises/bowling/package.json +71 -0
- data/tracks/ecmascript/exercises/two-fer/README.md +47 -0
- data/tracks/ecmascript/exercises/two-fer/example.js +4 -0
- data/tracks/ecmascript/exercises/two-fer/package.json +69 -0
- data/tracks/ecmascript/exercises/two-fer/two-fer.spec.js +18 -0
- data/tracks/fsharp/exercises/pascals-triangle/Example.fs +12 -8
- data/tracks/fsharp/exercises/pascals-triangle/PascalsTriangle.fs +2 -2
- data/tracks/fsharp/exercises/pascals-triangle/PascalsTriangleTest.fs +15 -12
- data/tracks/fsharp/generators/Generators.fs +19 -0
- data/tracks/fsharp/generators/Templates/_AssertThrows.liquid +1 -0
- data/tracks/java/docs/ABOUT.md +13 -31
- data/tracks/java/exercises/bracket-push/.meta/version +1 -1
- data/tracks/java/exercises/bracket-push/src/test/java/BracketCheckerTest.java +7 -1
- data/tracks/java/exercises/collatz-conjecture/.meta/version +1 -1
- data/tracks/java/exercises/etl/README.md +1 -1
- data/tracks/java/exercises/ocr-numbers/README.md +1 -1
- data/tracks/java/exercises/pascals-triangle/README.md +1 -1
- data/tracks/java/exercises/perfect-numbers/.meta/version +1 -1
- data/tracks/java/exercises/rna-transcription/README.md +1 -1
- data/tracks/java/exercises/secret-handshake/.meta/version +1 -1
- data/tracks/java/exercises/secret-handshake/src/test/java/HandshakeCalculatorTest.java +1 -9
- data/tracks/java/scripts/canonical_data_check.sh +104 -0
- data/tracks/javascript/exercises/twelve-days/example.js +23 -25
- data/tracks/julia/.travis.yml +1 -0
- data/tracks/kotlin/exercises/all-your-base/.meta/version +1 -0
- data/tracks/kotlin/exercises/all-your-base/src/test/kotlin/BaseConverterTest.kt +0 -3
- data/tracks/kotlin/exercises/change/.meta/version +1 -0
- data/tracks/kotlin/exercises/change/src/test/kotlin/ChangeCalculatorTest.kt +0 -3
- data/tracks/kotlin/exercises/clock/.meta/version +1 -0
- data/tracks/kotlin/exercises/clock/src/test/kotlin/ClockAddTest.kt +1 -4
- data/tracks/kotlin/exercises/clock/src/test/kotlin/ClockCreationTest.kt +1 -4
- data/tracks/kotlin/exercises/clock/src/test/kotlin/ClockEqualTest.kt +1 -4
- data/tracks/kotlin/exercises/collatz-conjecture/.meta/version +1 -0
- data/tracks/kotlin/exercises/collatz-conjecture/src/test/kotlin/CollatzCalculatorTest.kt +0 -3
- data/tracks/kotlin/exercises/complex-numbers/.meta/version +1 -0
- data/tracks/kotlin/exercises/complex-numbers/src/test/kotlin/ComplexNumberTest.kt +0 -3
- data/tracks/kotlin/exercises/diamond/.meta/version +1 -0
- data/tracks/kotlin/exercises/diamond/src/test/kotlin/DiamondPrinterTest.kt +0 -3
- data/tracks/kotlin/exercises/etl/README.md +1 -1
- data/tracks/kotlin/exercises/forth/.meta/version +1 -0
- data/tracks/kotlin/exercises/forth/src/test/kotlin/ForthEvaluatorTest.kt +0 -3
- data/tracks/kotlin/exercises/grains/.meta/version +1 -0
- data/tracks/kotlin/exercises/grains/src/test/kotlin/BoardTest.kt +0 -3
- data/tracks/kotlin/exercises/hamming/.meta/version +1 -0
- data/tracks/kotlin/exercises/hamming/src/test/kotlin/HammingTest.kt +0 -3
- data/tracks/kotlin/exercises/list-ops/.meta/version +1 -0
- data/tracks/kotlin/exercises/list-ops/src/test/kotlin/ListExtensionsTest.kt +0 -3
- data/tracks/kotlin/exercises/meetup/.meta/version +1 -0
- data/tracks/kotlin/exercises/meetup/src/test/kotlin/MeetupTest.kt +0 -3
- data/tracks/kotlin/exercises/minesweeper/.meta/version +1 -0
- data/tracks/kotlin/exercises/minesweeper/src/test/kotlin/MinesweeperBoardTest.kt +0 -3
- data/tracks/kotlin/exercises/pangram/.meta/version +1 -0
- data/tracks/kotlin/exercises/pangram/src/test/kotlin/PangramTest.kt +0 -3
- data/tracks/kotlin/exercises/pascals-triangle/README.md +1 -1
- data/tracks/kotlin/exercises/prime-factors/.meta/version +1 -0
- data/tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt +0 -3
- data/tracks/kotlin/exercises/rna-transcription/.meta/version +1 -0
- data/tracks/kotlin/exercises/rna-transcription/README.md +1 -1
- data/tracks/kotlin/exercises/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt +0 -3
- data/tracks/kotlin/exercises/robot-simulator/.meta/version +1 -0
- data/tracks/kotlin/exercises/robot-simulator/src/test/kotlin/RobotTest.kt +0 -3
- data/tracks/kotlin/exercises/rotational-cipher/.meta/version +1 -0
- data/tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt +0 -3
- data/tracks/kotlin/exercises/saddle-points/.meta/version +1 -0
- data/tracks/kotlin/exercises/saddle-points/src/test/kotlin/MatrixTest.kt +0 -3
- data/tracks/kotlin/exercises/say/.meta/version +1 -0
- data/tracks/kotlin/exercises/say/src/test/kotlin/NumberSpellerTest.kt +0 -3
- data/tracks/kotlin/exercises/secret-handshake/.meta/version +1 -0
- data/tracks/kotlin/exercises/secret-handshake/src/test/kotlin/HandshakeCalculatorTest.kt +0 -3
- data/tracks/kotlin/exercises/spiral-matrix/.meta/version +1 -0
- data/tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt +0 -3
- data/tracks/kotlin/exercises/sublist/.meta/version +1 -0
- data/tracks/kotlin/exercises/sublist/src/test/kotlin/SublistTest.kt +0 -3
- data/tracks/kotlin/scripts/canonical_data_check.sh +104 -0
- data/tracks/perl6/exercises/accumulate/accumulate.t +2 -3
- data/tracks/perl6/exercises/all-your-base/all-your-base.t +17 -18
- data/tracks/perl6/exercises/allergies/allergies.t +17 -18
- data/tracks/perl6/exercises/anagram/anagram.t +17 -18
- data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +17 -18
- data/tracks/perl6/exercises/bob/bob.t +20 -22
- data/tracks/perl6/exercises/bob/example.yaml +1 -2
- data/tracks/perl6/exercises/clock/clock.t +17 -18
- data/tracks/perl6/exercises/flatten-array/flatten-array.t +17 -18
- data/tracks/perl6/exercises/grade-school/grade-school.t +2 -3
- data/tracks/perl6/exercises/grains/grains.t +17 -18
- data/tracks/perl6/exercises/hello-world/example.yaml +1 -2
- data/tracks/perl6/exercises/hello-world/hello-world.t +20 -22
- data/tracks/perl6/exercises/leap/leap.t +17 -18
- data/tracks/perl6/exercises/linked-list/linked-list.t +2 -3
- data/tracks/perl6/exercises/luhn/luhn.t +17 -18
- data/tracks/perl6/exercises/phone-number/phone-number.t +17 -18
- data/tracks/perl6/exercises/raindrops/raindrops.t +17 -18
- data/tracks/perl6/exercises/rna-transcription/rna-transcription.t +17 -18
- data/tracks/perl6/exercises/robot-name/robot-name.t +2 -3
- data/tracks/perl6/exercises/scrabble-score/scrabble-score.t +17 -18
- data/tracks/perl6/exercises/space-age/space-age.t +17 -18
- data/tracks/perl6/exercises/word-count/word-count.t +17 -18
- data/tracks/perl6/exercises/wordy/wordy.t +17 -18
- data/tracks/perl6/templates/test.mustache +9 -10
- data/tracks/purescript/config.json +11 -0
- data/tracks/purescript/exercises/rna-transcription/README.md +25 -0
- data/tracks/purescript/exercises/rna-transcription/bower.json +26 -0
- data/tracks/purescript/exercises/rna-transcription/examples/src/RNATranscription.purs +18 -0
- data/tracks/purescript/exercises/rna-transcription/src/RNATranscription.purs +3 -0
- data/tracks/purescript/exercises/rna-transcription/test/Main.purs +48 -0
- data/tracks/python/exercises/variable-length-quantity/example.py +6 -6
- data/tracks/python/exercises/variable-length-quantity/variable_length_quantity.py +2 -2
- data/tracks/ruby/config.json +6 -0
- data/tracks/ruby/exercises/complex-numbers/.meta/.version +1 -0
- data/tracks/ruby/exercises/complex-numbers/.meta/generator/complex_numbers_case.rb +44 -0
- data/tracks/ruby/exercises/complex-numbers/.meta/solutions/complex_numbers.rb +49 -0
- data/tracks/ruby/exercises/complex-numbers/README.md +64 -0
- data/tracks/ruby/exercises/complex-numbers/complex_numbers_test.rb +207 -0
- data/tracks/ruby/exercises/crypto-square/.meta/.version +1 -0
- data/tracks/ruby/exercises/crypto-square/.meta/generator/crypto_square_case.rb +19 -0
- data/tracks/ruby/exercises/crypto-square/.meta/solutions/crypto_square.rb +20 -15
- data/tracks/ruby/exercises/crypto-square/README.md +10 -8
- data/tracks/ruby/exercises/crypto-square/crypto_square_test.rb +45 -81
- data/tracks/ruby/exercises/flatten-array/.meta/.version +1 -0
- data/tracks/ruby/exercises/flatten-array/.meta/generator/flatten_array_case.rb +11 -0
- data/tracks/ruby/exercises/flatten-array/.meta/solutions/flatten_array.rb +5 -2
- data/tracks/ruby/exercises/flatten-array/flatten_array_test.rb +32 -7
- data/tracks/ruby/exercises/hamming/hamming_test.rb +3 -3
- data/tracks/ruby/exercises/isogram/isogram_test.rb +4 -4
- data/tracks/ruby/exercises/leap/leap_test.rb +2 -2
- data/tracks/ruby/exercises/pig-latin/.meta/.version +1 -1
- data/tracks/ruby/exercises/pig-latin/.meta/solutions/pig_latin.rb +2 -2
- data/tracks/ruby/exercises/pig-latin/pig_latin_test.rb +17 -7
- data/tracks/ruby/exercises/queen-attack/.meta/generator/queen_attack_case.rb +1 -1
- data/tracks/ruby/exercises/queen-attack/queen_attack_test.rb +7 -7
- data/tracks/ruby/exercises/sum-of-multiples/.meta/.version +1 -1
- data/tracks/ruby/exercises/sum-of-multiples/.meta/solutions/sum_of_multiples.rb +1 -1
- data/tracks/ruby/exercises/sum-of-multiples/sum_of_multiples_test.rb +7 -2
- metadata +53 -2
|
@@ -21,7 +21,7 @@ if ::($exercise).^ver !~~ $version {
|
|
|
21
21
|
|
|
22
22
|
require ::($module) <&encode &decode>;
|
|
23
23
|
|
|
24
|
-
my $c-data;
|
|
24
|
+
my $c-data = from-json $=pod.pop.contents;
|
|
25
25
|
for @($c-data<cases>) {
|
|
26
26
|
my $test = .<description> ~~ 'encode' ?? 'encode' !! 'decode';
|
|
27
27
|
subtest $test => {
|
|
@@ -31,21 +31,8 @@ for @($c-data<cases>) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
exit;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
subtest 'canonical-data' => {
|
|
40
|
-
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
41
|
-
$dir.IO.resolve.basename
|
|
42
|
-
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
43
|
-
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
44
|
-
flunk 'problem-specifications file not found';
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
INIT {
|
|
48
|
-
$c-data := from-json q:to/END/;
|
|
34
|
+
=head2 Canonical Data
|
|
35
|
+
=begin code
|
|
49
36
|
|
|
50
37
|
{
|
|
51
38
|
"exercise": "atbash-cipher",
|
|
@@ -143,7 +130,19 @@ $c-data := from-json q:to/END/;
|
|
|
143
130
|
]
|
|
144
131
|
}
|
|
145
132
|
|
|
146
|
-
|
|
133
|
+
=end code
|
|
147
134
|
|
|
148
|
-
|
|
135
|
+
unless %*ENV<EXERCISM> {
|
|
136
|
+
skip-rest 'exercism tests';
|
|
137
|
+
exit;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
subtest 'canonical-data' => {
|
|
141
|
+
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
142
|
+
$dir.IO.resolve.basename
|
|
143
|
+
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
144
|
+
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
145
|
+
flunk 'problem-specifications file not found';
|
|
149
146
|
}
|
|
147
|
+
|
|
148
|
+
INIT { $module = 'Example' if %*ENV<EXERCISM> }
|
|
@@ -28,28 +28,12 @@ subtest 'Class methods', {
|
|
|
28
28
|
ok ::($exercise).can($_), $_ for <hey>;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
my $c-data;
|
|
32
|
-
|
|
33
|
-
and check that Bob gives us the correct response for each one.]
|
|
31
|
+
my $c-data = from-json $=pod.pop.contents;
|
|
32
|
+
# Go through the cases and check that Bob gives us the correct responses.
|
|
34
33
|
is ::($exercise).?hey(.<input>), |.<expected description> for @($c-data<cases>);
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
unless %*ENV<EXERCISM> {
|
|
39
|
-
skip-rest 'exercism tests';
|
|
40
|
-
exit;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
subtest 'canonical-data' => {
|
|
44
|
-
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
45
|
-
$dir.IO.resolve.basename
|
|
46
|
-
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
47
|
-
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
48
|
-
flunk 'problem-specifications file not found';
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
INIT {
|
|
52
|
-
$c-data := from-json q:to/END/;
|
|
35
|
+
=head2 Canonical Data
|
|
36
|
+
=begin code
|
|
53
37
|
|
|
54
38
|
{
|
|
55
39
|
"exercise": "bob",
|
|
@@ -208,7 +192,21 @@ $c-data := from-json q:to/END/;
|
|
|
208
192
|
]
|
|
209
193
|
}
|
|
210
194
|
|
|
211
|
-
|
|
195
|
+
=end code
|
|
212
196
|
|
|
213
|
-
|
|
197
|
+
#`[Don't worry about the stuff below here for your exercise.
|
|
198
|
+
This is for Exercism folks to check that everything is in order.]
|
|
199
|
+
unless %*ENV<EXERCISM> {
|
|
200
|
+
skip-rest 'exercism tests';
|
|
201
|
+
exit;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
subtest 'canonical-data' => {
|
|
205
|
+
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
206
|
+
$dir.IO.resolve.basename
|
|
207
|
+
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
208
|
+
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
209
|
+
flunk 'problem-specifications file not found';
|
|
214
210
|
}
|
|
211
|
+
|
|
212
|
+
INIT { $module = 'Example' if %*ENV<EXERCISM> }
|
|
@@ -3,8 +3,7 @@ version: 1
|
|
|
3
3
|
plan: 28
|
|
4
4
|
methods: hey
|
|
5
5
|
tests: |
|
|
6
|
-
|
|
7
|
-
and check that Bob gives us the correct response for each one.]
|
|
6
|
+
# Go through the cases and check that Bob gives us the correct responses.
|
|
8
7
|
is ::($exercise).?hey(.<input>), |.<expected description> for @($c-data<cases>);
|
|
9
8
|
|
|
10
9
|
exercise_comment: The name of this exercise.
|
|
@@ -23,7 +23,7 @@ subtest 'Class methods', {
|
|
|
23
23
|
ok ::($exercise).can($_), $_ for <time add-minutes>;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
my $c-data;
|
|
26
|
+
my $c-data = from-json $=pod.pop.contents;
|
|
27
27
|
for @($c-data<cases>) {
|
|
28
28
|
for @(.<cases>) -> $case {
|
|
29
29
|
given $case<property> {
|
|
@@ -48,21 +48,8 @@ for @($c-data<cases>) {
|
|
|
48
48
|
todo 'optional test' unless %*ENV<EXERCISM>;
|
|
49
49
|
is ::($exercise).new(:0hour,:0minute).?add-minutes(65).?time, '01:05', 'add-minutes method can be chained';
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
exit;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
subtest 'canonical-data' => {
|
|
57
|
-
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
58
|
-
$dir.IO.resolve.basename
|
|
59
|
-
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
60
|
-
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
61
|
-
flunk 'problem-specifications file not found';
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
INIT {
|
|
65
|
-
$c-data := from-json q:to/END/;
|
|
51
|
+
=head2 Canonical Data
|
|
52
|
+
=begin code
|
|
66
53
|
|
|
67
54
|
{
|
|
68
55
|
"exercise": "clock",
|
|
@@ -554,7 +541,19 @@ $c-data := from-json q:to/END/;
|
|
|
554
541
|
]
|
|
555
542
|
}
|
|
556
543
|
|
|
557
|
-
|
|
544
|
+
=end code
|
|
558
545
|
|
|
559
|
-
|
|
546
|
+
unless %*ENV<EXERCISM> {
|
|
547
|
+
skip-rest 'exercism tests';
|
|
548
|
+
exit;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
subtest 'canonical-data' => {
|
|
552
|
+
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
553
|
+
$dir.IO.resolve.basename
|
|
554
|
+
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
555
|
+
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
556
|
+
flunk 'problem-specifications file not found';
|
|
560
557
|
}
|
|
558
|
+
|
|
559
|
+
INIT { $module = 'Example' if %*ENV<EXERCISM> }
|
|
@@ -21,24 +21,11 @@ if ::($exercise).^ver !~~ $version {
|
|
|
21
21
|
|
|
22
22
|
require ::($module) <&flatten-array>;
|
|
23
23
|
|
|
24
|
-
my $c-data;
|
|
24
|
+
my $c-data = from-json $=pod.pop.contents;
|
|
25
25
|
is-deeply flatten-array(.<input>), |.<expected description> for @($c-data<cases>);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exit;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
subtest 'canonical-data' => {
|
|
33
|
-
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
34
|
-
$dir.IO.resolve.basename
|
|
35
|
-
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
36
|
-
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
37
|
-
flunk 'problem-specifications file not found';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
INIT {
|
|
41
|
-
$c-data := from-json q:to/END/;
|
|
27
|
+
=head2 Canonical Data
|
|
28
|
+
=begin code
|
|
42
29
|
|
|
43
30
|
{
|
|
44
31
|
"exercise": "flatten-array",
|
|
@@ -83,7 +70,19 @@ $c-data := from-json q:to/END/;
|
|
|
83
70
|
]
|
|
84
71
|
}
|
|
85
72
|
|
|
86
|
-
|
|
73
|
+
=end code
|
|
87
74
|
|
|
88
|
-
|
|
75
|
+
unless %*ENV<EXERCISM> {
|
|
76
|
+
skip-rest 'exercism tests';
|
|
77
|
+
exit;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
subtest 'canonical-data' => {
|
|
81
|
+
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
82
|
+
$dir.IO.resolve.basename
|
|
83
|
+
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
84
|
+
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
85
|
+
flunk 'problem-specifications file not found';
|
|
89
86
|
}
|
|
87
|
+
|
|
88
|
+
INIT { $module = 'Example' if %*ENV<EXERCISM> }
|
|
@@ -38,6 +38,5 @@ subtest 'Additional students', {
|
|
|
38
38
|
ok $roster.?add-student(:name($_), :3grade), "Add $_ to grade 3" for <Tom Dick Harry>;
|
|
39
39
|
}
|
|
40
40
|
is $roster.?list-all, ('Grade 1', <Anna Barb Charlie>, 'Grade 2', <Alex Jim Zoe>, 'Grade 3', <Dick Harry Tom>), 'List all';
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
41
|
+
|
|
42
|
+
INIT { $module = 'Example' if %*ENV<EXERCISM> }
|
|
@@ -21,7 +21,7 @@ if ::($exercise).^ver !~~ $version {
|
|
|
21
21
|
|
|
22
22
|
require ::($module) <&grains-on-square &total-grains>;
|
|
23
23
|
|
|
24
|
-
my $c-data;
|
|
24
|
+
my $c-data = from-json $=pod.pop.contents;
|
|
25
25
|
for @($c-data<cases>[0]<cases>) {
|
|
26
26
|
if .<expected> == -1 {
|
|
27
27
|
throws-like { grains-on-square(.<input>) }, Exception, .<description>;
|
|
@@ -31,21 +31,8 @@ for @($c-data<cases>[0]<cases>) {
|
|
|
31
31
|
}
|
|
32
32
|
is total-grains, |$c-data<cases>[1]<expected description>;
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
exit;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
subtest 'canonical-data' => {
|
|
40
|
-
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
41
|
-
$dir.IO.resolve.basename
|
|
42
|
-
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
43
|
-
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
44
|
-
flunk 'problem-specifications file not found';
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
INIT {
|
|
48
|
-
$c-data := from-json q:to/END/;
|
|
34
|
+
=head2 Canonical Data
|
|
35
|
+
=begin code
|
|
49
36
|
|
|
50
37
|
{
|
|
51
38
|
"exercise": "grains",
|
|
@@ -129,7 +116,19 @@ $c-data := from-json q:to/END/;
|
|
|
129
116
|
]
|
|
130
117
|
}
|
|
131
118
|
|
|
132
|
-
|
|
119
|
+
=end code
|
|
133
120
|
|
|
134
|
-
|
|
121
|
+
unless %*ENV<EXERCISM> {
|
|
122
|
+
skip-rest 'exercism tests';
|
|
123
|
+
exit;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
subtest 'canonical-data' => {
|
|
127
|
+
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
128
|
+
$dir.IO.resolve.basename
|
|
129
|
+
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
130
|
+
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
131
|
+
flunk 'problem-specifications file not found';
|
|
135
132
|
}
|
|
133
|
+
|
|
134
|
+
INIT { $module = 'Example' if %*ENV<EXERCISM> }
|
|
@@ -3,8 +3,7 @@ version: 2
|
|
|
3
3
|
plan: 3
|
|
4
4
|
imports: '&hello'
|
|
5
5
|
tests: |
|
|
6
|
-
|
|
7
|
-
and check that &hello gives us the correct response.]
|
|
6
|
+
# Go through the cases and check that &hello gives us the correct response.
|
|
8
7
|
is hello, |.<expected description> for @($c-data<cases>);
|
|
9
8
|
|
|
10
9
|
exercise_comment: The name of this exercise.
|
|
@@ -25,28 +25,12 @@ if ::($exercise).^ver !~~ $version {
|
|
|
25
25
|
#`[Import '&hello' from 'HelloWorld']
|
|
26
26
|
require ::($module) <&hello>;
|
|
27
27
|
|
|
28
|
-
my $c-data;
|
|
29
|
-
|
|
30
|
-
and check that &hello gives us the correct response.]
|
|
28
|
+
my $c-data = from-json $=pod.pop.contents;
|
|
29
|
+
# Go through the cases and check that &hello gives us the correct response.
|
|
31
30
|
is hello, |.<expected description> for @($c-data<cases>);
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
unless %*ENV<EXERCISM> {
|
|
36
|
-
skip-rest 'exercism tests';
|
|
37
|
-
exit;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
subtest 'canonical-data' => {
|
|
41
|
-
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
42
|
-
$dir.IO.resolve.basename
|
|
43
|
-
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
44
|
-
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
45
|
-
flunk 'problem-specifications file not found';
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
INIT {
|
|
49
|
-
$c-data := from-json q:to/END/;
|
|
32
|
+
=head2 Canonical Data
|
|
33
|
+
=begin code
|
|
50
34
|
|
|
51
35
|
{
|
|
52
36
|
"exercise": "hello-world",
|
|
@@ -60,7 +44,21 @@ $c-data := from-json q:to/END/;
|
|
|
60
44
|
]
|
|
61
45
|
}
|
|
62
46
|
|
|
63
|
-
|
|
47
|
+
=end code
|
|
64
48
|
|
|
65
|
-
|
|
49
|
+
#`[Don't worry about the stuff below here for your exercise.
|
|
50
|
+
This is for Exercism folks to check that everything is in order.]
|
|
51
|
+
unless %*ENV<EXERCISM> {
|
|
52
|
+
skip-rest 'exercism tests';
|
|
53
|
+
exit;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
subtest 'canonical-data' => {
|
|
57
|
+
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
58
|
+
$dir.IO.resolve.basename
|
|
59
|
+
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
60
|
+
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
61
|
+
flunk 'problem-specifications file not found';
|
|
66
62
|
}
|
|
63
|
+
|
|
64
|
+
INIT { $module = 'Example' if %*ENV<EXERCISM> }
|
|
@@ -21,24 +21,11 @@ if ::($exercise).^ver !~~ $version {
|
|
|
21
21
|
|
|
22
22
|
require ::($module) <&is-leap-year>;
|
|
23
23
|
|
|
24
|
-
my $c-data;
|
|
24
|
+
my $c-data = from-json $=pod.pop.contents;
|
|
25
25
|
is is-leap-year(.<input>), |.<expected description> for @($c-data<cases>);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exit;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
subtest 'canonical-data' => {
|
|
33
|
-
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
34
|
-
$dir.IO.resolve.basename
|
|
35
|
-
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
36
|
-
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
37
|
-
flunk 'problem-specifications file not found';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
INIT {
|
|
41
|
-
$c-data := from-json q:to/END/;
|
|
27
|
+
=head2 Canonical Data
|
|
28
|
+
=begin code
|
|
42
29
|
|
|
43
30
|
{
|
|
44
31
|
"exercise": "leap",
|
|
@@ -71,7 +58,19 @@ $c-data := from-json q:to/END/;
|
|
|
71
58
|
]
|
|
72
59
|
}
|
|
73
60
|
|
|
74
|
-
|
|
61
|
+
=end code
|
|
75
62
|
|
|
76
|
-
|
|
63
|
+
unless %*ENV<EXERCISM> {
|
|
64
|
+
skip-rest 'exercism tests';
|
|
65
|
+
exit;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
subtest 'canonical-data' => {
|
|
69
|
+
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
70
|
+
$dir.IO.resolve.basename
|
|
71
|
+
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
72
|
+
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
73
|
+
flunk 'problem-specifications file not found';
|
|
77
74
|
}
|
|
75
|
+
|
|
76
|
+
INIT { $module = 'Example' if %*ENV<EXERCISM> }
|
|
@@ -21,24 +21,11 @@ if ::($exercise).^ver !~~ $version {
|
|
|
21
21
|
|
|
22
22
|
require ::($module) <&is-luhn-valid>;
|
|
23
23
|
|
|
24
|
-
my $c-data;
|
|
24
|
+
my $c-data = from-json $=pod.pop.contents;
|
|
25
25
|
is .<input>.&is-luhn-valid, |.<expected description> for @($c-data<cases>);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exit;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
subtest 'canonical-data' => {
|
|
33
|
-
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
34
|
-
$dir.IO.resolve.basename
|
|
35
|
-
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
36
|
-
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
37
|
-
flunk 'problem-specifications file not found';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
INIT {
|
|
41
|
-
$c-data := from-json q:to/END/;
|
|
27
|
+
=head2 Canonical Data
|
|
28
|
+
=begin code
|
|
42
29
|
|
|
43
30
|
{
|
|
44
31
|
"exercise": "luhn",
|
|
@@ -125,7 +112,19 @@ $c-data := from-json q:to/END/;
|
|
|
125
112
|
]
|
|
126
113
|
}
|
|
127
114
|
|
|
128
|
-
|
|
115
|
+
=end code
|
|
129
116
|
|
|
130
|
-
|
|
117
|
+
unless %*ENV<EXERCISM> {
|
|
118
|
+
skip-rest 'exercism tests';
|
|
119
|
+
exit;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
subtest 'canonical-data' => {
|
|
123
|
+
(my $c-data-file = "$dir/../../problem-specifications/exercises/{
|
|
124
|
+
$dir.IO.resolve.basename
|
|
125
|
+
}/canonical-data.json".IO.resolve) ~~ :f ??
|
|
126
|
+
is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
|
|
127
|
+
flunk 'problem-specifications file not found';
|
|
131
128
|
}
|
|
129
|
+
|
|
130
|
+
INIT { $module = 'Example' if %*ENV<EXERCISM> }
|