trackler 2.2.1.100 → 2.2.1.101
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/kindergarten-garden/canonical-data.json +37 -19
- data/problem-specifications/exercises/ocr-numbers/canonical-data.json +144 -110
- data/problem-specifications/exercises/palindrome-products/canonical-data.json +49 -25
- data/problem-specifications/exercises/poker/canonical-data.json +171 -115
- data/problem-specifications/exercises/prime-factors/canonical-data.json +22 -8
- data/problem-specifications/exercises/protein-translation/canonical-data.json +70 -24
- data/problem-specifications/exercises/proverb/canonical-data.json +24 -12
- data/problem-specifications/exercises/queen-attack/canonical-data.json +115 -91
- data/problem-specifications/exercises/rail-fence-cipher/canonical-data.json +25 -13
- data/problem-specifications/exercises/raindrops/canonical-data.json +55 -19
- data/problem-specifications/exercises/rational-numbers/canonical-data.json +374 -0
- data/problem-specifications/exercises/rational-numbers/description.md +27 -0
- data/problem-specifications/exercises/rational-numbers/metadata.yml +4 -0
- data/problem-specifications/exercises/rectangles/canonical-data.json +93 -67
- data/problem-specifications/exercises/reverse-string/canonical-data.json +16 -6
- data/problem-specifications/exercises/rna-transcription/metadata.yml +3 -3
- data/problem-specifications/exercises/roman-numerals/canonical-data.json +10 -2
- data/tracks/bash/config.json +11 -11
- data/tracks/c/exercises/roman-numerals/test/test_roman_numerals.c +7 -0
- data/tracks/clojure/exercises/armstrong-numbers/README.md +1 -1
- data/tracks/delphi/config.json +11 -0
- data/tracks/delphi/exercises/clock/uClockExample.pas +6 -1
- data/tracks/delphi/exercises/clock/uClockTest.pas +22 -19
- data/tracks/delphi/exercises/isbn-verifier/README.md +1 -1
- data/tracks/delphi/exercises/reverse-string/README.md +1 -1
- data/tracks/delphi/exercises/rna-transcription/README.md +1 -1
- data/tracks/delphi/exercises/roman-numerals/uRomanNumeralsTest.pas +14 -0
- data/tracks/delphi/exercises/space-age/README.md +45 -0
- data/tracks/delphi/exercises/space-age/SpaceAge.dpr +60 -0
- data/tracks/delphi/exercises/space-age/uSpaceAgeExample.pas +120 -0
- data/tracks/delphi/exercises/space-age/uSpaceAgeTests.pas +135 -0
- data/tracks/delphi/exercises/two-fer/README.md +1 -1
- data/tracks/elixir/exercises/nth-prime/nth_prime.exs +0 -1
- data/tracks/fsharp/exercises/pov/PovTest.fs +66 -53
- data/tracks/fsharp/exercises/space-age/Example.fs +11 -11
- data/tracks/fsharp/exercises/space-age/SpaceAge.fs +1 -1
- data/tracks/fsharp/exercises/space-age/SpaceAgeTest.fs +21 -34
- data/tracks/fsharp/exercises/triangle/Example.fs +11 -16
- data/tracks/fsharp/exercises/triangle/Triangle.fs +4 -5
- data/tracks/fsharp/exercises/triangle/TriangleTest.fs +44 -31
- data/tracks/fsharp/generators/Generators.fs +121 -0
- data/tracks/go/config.json +12 -0
- data/tracks/go/exercises/clock/.meta/gen.go +37 -13
- data/tracks/go/exercises/clock/cases_test.go +10 -10
- data/tracks/go/exercises/clock/clock_test.go +16 -2
- data/tracks/go/exercises/clock/example.go +4 -0
- data/tracks/go/exercises/clock/example_clock_test.go +3 -3
- data/tracks/go/exercises/parallel-letter-frequency/.meta/hints.md +33 -0
- data/tracks/go/exercises/parallel-letter-frequency/README.md +35 -0
- data/tracks/go/exercises/raindrops/.meta/hints.md +7 -4
- data/tracks/go/exercises/raindrops/README.md +12 -0
- data/tracks/go/exercises/roman-numerals/.meta/gen.go +4 -2
- data/tracks/go/exercises/roman-numerals/cases_test.go +3 -2
- data/tracks/go/exercises/space-age/.meta/hints.md +10 -0
- data/tracks/go/exercises/space-age/README.md +14 -1
- data/tracks/go/exercises/twelve-days/README.md +2 -5
- data/tracks/go/exercises/two-bucket/.meta/gen.go +62 -0
- data/tracks/go/exercises/two-bucket/.meta/hints.md +16 -0
- data/tracks/go/exercises/two-bucket/README.md +72 -0
- data/tracks/go/exercises/two-bucket/cases_test.go +44 -0
- data/tracks/go/exercises/two-bucket/example.go +198 -0
- data/tracks/go/exercises/two-bucket/two_bucket_test.go +61 -0
- data/tracks/idris/.travis.yml +3 -2
- data/tracks/idris/bin/fetch-idris-testing.sh +11 -0
- data/tracks/idris/bin/solve_exercises.sh +2 -2
- data/tracks/idris/config.json +11 -0
- data/tracks/idris/config/exercise_readme.go.tmpl +0 -3
- data/tracks/idris/docs/INSTALLATION.md +22 -0
- data/tracks/idris/docs/TESTS.md +12 -4
- data/tracks/idris/exercises/accumulate/src/Accumulate.idr +5 -0
- data/tracks/idris/exercises/hamming/Hamming.ipkg +2 -0
- data/tracks/idris/exercises/hamming/src/{example.idr → Example.idr} +5 -1
- data/tracks/idris/exercises/hamming/src/Hamming.idr +13 -5
- data/tracks/idris/exercises/hamming/src/Test/Hamming.idr +31 -58
- data/tracks/idris/exercises/hello-world/HelloWorld.ipkg +2 -0
- data/tracks/idris/exercises/hello-world/src/Example.idr +9 -0
- data/tracks/idris/exercises/hello-world/src/HelloWorld.idr +6 -1
- data/tracks/idris/exercises/hello-world/src/Test/HelloWorld.idr +18 -18
- data/tracks/idris/exercises/leap/Leap.ipkg +2 -0
- data/tracks/idris/exercises/leap/src/{example.idr → Example.idr} +4 -0
- data/tracks/idris/exercises/leap/src/Leap.idr +5 -1
- data/tracks/idris/exercises/leap/src/Test/Leap.idr +21 -30
- data/tracks/idris/exercises/rna-transcription/Makefile +23 -0
- data/tracks/idris/exercises/rna-transcription/README.md +27 -0
- data/tracks/idris/exercises/rna-transcription/RnaTranscription.ipkg +5 -0
- data/tracks/idris/exercises/rna-transcription/src/RnaTranscription.idr +17 -0
- data/tracks/idris/exercises/rna-transcription/src/Test/RnaTranscription.idr +27 -0
- data/tracks/idris/exercises/rna-transcription/src/example.idr +35 -0
- data/tracks/java/exercises/etl/.meta/version +1 -0
- data/tracks/java/exercises/gigasecond/.meta/version +1 -0
- data/tracks/java/exercises/isbn-verifier/README.md +1 -1
- data/tracks/java/exercises/nucleotide-count/.meta/src/reference/java/NucleotideCounter.java +7 -1
- data/tracks/java/exercises/nucleotide-count/.meta/version +1 -0
- data/tracks/java/exercises/nucleotide-count/src/test/java/NucleotideCounterTest.java +19 -54
- data/tracks/java/exercises/proverb/.meta/version +1 -0
- data/tracks/java/exercises/reverse-string/README.md +1 -1
- data/tracks/java/exercises/rna-transcription/README.md +1 -1
- data/tracks/java/exercises/sum-of-multiples/.meta/version +1 -0
- data/tracks/java/exercises/sum-of-multiples/src/test/java/SumOfMultiplesTest.java +13 -1
- data/tracks/kotlin/config/exercise_readme.go.tmpl +0 -3
- data/tracks/kotlin/docs/TESTS.md +1 -1
- data/tracks/objective-c/config.json +11 -0
- data/tracks/objective-c/exercises/collatz-conjecture/CollatzConjectureExample.h +7 -0
- data/tracks/objective-c/exercises/collatz-conjecture/CollatzConjectureExample.m +26 -0
- data/tracks/objective-c/exercises/collatz-conjecture/CollatzConjectureTest.m +39 -0
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.pbxproj +31 -1
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/OCLint.xcscheme +3 -1
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/xobjectivecTest.xcscheme +3 -1
- data/tracks/ocaml/exercises/forth/example.ml +9 -9
- data/tracks/ocaml/tools/test-generator/Makefile +3 -9
- data/tracks/ocaml/tools/test-generator/src/test_gen.ml +18 -16
- data/tracks/perl6/exercises/acronym/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/acronym/acronym.t +4 -14
- data/tracks/perl6/exercises/all-your-base/all-your-base.t +0 -2
- data/tracks/perl6/exercises/allergies/allergies.t +0 -2
- data/tracks/perl6/exercises/anagram/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/anagram/anagram.t +2 -40
- data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +0 -1
- data/tracks/perl6/exercises/bob/bob.t +0 -2
- data/tracks/perl6/exercises/clock/.meta/exercise-data.yaml +15 -11
- data/tracks/perl6/exercises/clock/.meta/solutions/Clock.pm6 +5 -1
- data/tracks/perl6/exercises/clock/Clock.pm6 +1 -1
- data/tracks/perl6/exercises/clock/clock.t +314 -217
- data/tracks/perl6/exercises/etl/etl.t +0 -2
- data/tracks/perl6/exercises/flatten-array/flatten-array.t +0 -2
- data/tracks/perl6/exercises/grains/grains.t +0 -2
- data/tracks/perl6/exercises/hamming/.meta/exercise-data.yaml +2 -2
- data/tracks/perl6/exercises/hamming/hamming.t +63 -35
- data/tracks/perl6/exercises/hello-world/hello-world.t +2 -3
- data/tracks/perl6/exercises/leap/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/leap/leap.t +14 -8
- data/tracks/perl6/exercises/luhn/luhn.t +0 -2
- data/tracks/perl6/exercises/nucleotide-count/.meta/exercise-data.yaml +2 -2
- data/tracks/perl6/exercises/nucleotide-count/nucleotide-count.t +18 -10
- data/tracks/perl6/exercises/pangram/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/pangram/pangram.t +32 -14
- data/tracks/perl6/exercises/phone-number/.meta/exercise-data.yaml +4 -4
- data/tracks/perl6/exercises/phone-number/.meta/solutions/Phone.pm6 +1 -1
- data/tracks/perl6/exercises/phone-number/Phone.pm6 +1 -1
- data/tracks/perl6/exercises/phone-number/phone-number.t +59 -21
- data/tracks/perl6/exercises/raindrops/raindrops.t +0 -2
- data/tracks/perl6/exercises/rna-transcription/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/rna-transcription/README.md +1 -1
- data/tracks/perl6/exercises/rna-transcription/rna-transcription.t +17 -9
- data/tracks/perl6/exercises/roman-numerals/.meta/exercise-data.yaml +3 -3
- data/tracks/perl6/exercises/roman-numerals/.meta/solutions/RomanNumerals.pm6 +1 -1
- data/tracks/perl6/exercises/roman-numerals/RomanNumerals.pm6 +1 -1
- data/tracks/perl6/exercises/roman-numerals/roman-numerals.t +66 -24
- data/tracks/perl6/exercises/scrabble-score/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/scrabble-score/scrabble-score.t +35 -15
- data/tracks/perl6/exercises/space-age/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/space-age/space-age.t +34 -20
- data/tracks/perl6/exercises/two-fer/.meta/exercise-data.yaml +2 -2
- data/tracks/perl6/exercises/two-fer/two-fer.t +15 -11
- data/tracks/perl6/exercises/word-count/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/word-count/word-count.t +46 -26
- data/tracks/perl6/exercises/wordy/.meta/exercise-data.yaml +2 -2
- data/tracks/perl6/exercises/wordy/wordy.t +51 -21
- data/tracks/perl6/lib/Exercism/Generator.pm6 +1 -1
- data/tracks/perl6/t/generated-tests.t +1 -1
- data/tracks/perl6/templates/test.mustache +0 -1
- data/tracks/python/config.json +12 -0
- data/tracks/python/exercises/forth/example.py +1 -1
- data/tracks/python/exercises/forth/forth_test.py +43 -38
- data/tracks/python/exercises/spiral-matrix/README.md +42 -0
- data/tracks/python/exercises/spiral-matrix/example.py +11 -0
- data/tracks/python/exercises/spiral-matrix/spiral_matrix.py +2 -0
- data/tracks/python/exercises/spiral-matrix/spiral_matrix_test.py +40 -0
- data/tracks/racket/config/exercise_readme.go.tmpl +24 -4
- data/tracks/racket/exercises/accumulate/README.md +3 -6
- data/tracks/racket/exercises/acronym/README.md +3 -4
- data/tracks/racket/exercises/allergies/README.md +3 -4
- data/tracks/racket/exercises/anagram/README.md +3 -3
- data/tracks/racket/exercises/bob/README.md +5 -3
- data/tracks/racket/exercises/collatz-conjecture/README.md +3 -3
- data/tracks/racket/exercises/difference-of-squares/README.md +3 -3
- data/tracks/racket/exercises/etl/README.md +6 -4
- data/tracks/racket/exercises/gigasecond/README.md +3 -3
- data/tracks/racket/exercises/grains/README.md +3 -4
- data/tracks/racket/exercises/grep/README.md +15 -15
- data/tracks/racket/exercises/hamming/README.md +3 -3
- data/tracks/racket/exercises/hello-world/README.md +1 -1
- data/tracks/racket/exercises/leap/README.md +4 -4
- data/tracks/racket/exercises/list-ops/README.md +3 -4
- data/tracks/racket/exercises/meetup/README.md +19 -15
- data/tracks/racket/exercises/nucleotide-count/README.md +11 -25
- data/tracks/racket/exercises/perfect-numbers/README.md +5 -5
- data/tracks/racket/exercises/phone-number/README.md +7 -6
- data/tracks/racket/exercises/raindrops/README.md +3 -3
- data/tracks/racket/exercises/rna-transcription/README.md +4 -4
- data/tracks/racket/exercises/roman-numerals/README.md +4 -4
- data/tracks/racket/exercises/say/README.md +3 -3
- data/tracks/racket/exercises/scrabble-score/README.md +6 -4
- data/tracks/racket/exercises/word-count/README.md +4 -5
- data/tracks/scheme/config/exercise_readme.go.tmpl +0 -3
- data/tracks/scheme/docs/INSTALLATION.md +23 -14
- metadata +40 -9
- data/tracks/idris/docs/EXERCISE_README_INSERT.md +0 -0
- data/tracks/idris/exercises/hello-world/src/example.idr +0 -5
- data/tracks/kotlin/config/exercise-readme-insert.md +0 -1
- data/tracks/racket/docs/EXERCISE_README_INSERT.md +0 -23
- data/tracks/scheme/docs/EXERCISE_README_INSERT.md +0 -0
@@ -4,9 +4,9 @@ use Test;
|
|
4
4
|
use JSON::Fast;
|
5
5
|
use lib $?FILE.IO.dirname;
|
6
6
|
use RomanNumerals;
|
7
|
-
plan
|
7
|
+
plan 19;
|
8
8
|
|
9
|
-
my Version:D $version =
|
9
|
+
my Version:D $version = v3;
|
10
10
|
|
11
11
|
if RomanNumerals.^ver !~~ $version {
|
12
12
|
warn "\nExercise version mismatch. Further tests may fail!"
|
@@ -16,125 +16,167 @@ if RomanNumerals.^ver !~~ $version {
|
|
16
16
|
|
17
17
|
my $c-data = from-json $=pod.pop.contents;
|
18
18
|
for $c-data<cases>.values {
|
19
|
-
is to-roman(.<number>), |.<expected description>;
|
19
|
+
is to-roman(.<input><number>), |.<expected description>;
|
20
20
|
}
|
21
21
|
|
22
22
|
=head2 Canonical Data
|
23
23
|
=begin code
|
24
|
-
|
25
24
|
{
|
26
25
|
"exercise": "roman-numerals",
|
27
|
-
"version": "1.
|
26
|
+
"version": "1.2.0",
|
28
27
|
"cases": [
|
29
28
|
{
|
30
29
|
"description": "1 is a single I",
|
31
30
|
"property": "roman",
|
32
|
-
"
|
31
|
+
"input": {
|
32
|
+
"number": 1
|
33
|
+
},
|
33
34
|
"expected": "I"
|
34
35
|
},
|
35
36
|
{
|
36
37
|
"description": "2 is two I's",
|
37
38
|
"property": "roman",
|
38
|
-
"
|
39
|
+
"input": {
|
40
|
+
"number": 2
|
41
|
+
},
|
39
42
|
"expected": "II"
|
40
43
|
},
|
41
44
|
{
|
42
45
|
"description": "3 is three I's",
|
43
46
|
"property": "roman",
|
44
|
-
"
|
47
|
+
"input": {
|
48
|
+
"number": 3
|
49
|
+
},
|
45
50
|
"expected": "III"
|
46
51
|
},
|
47
52
|
{
|
48
53
|
"description": "4, being 5 - 1, is IV",
|
49
54
|
"property": "roman",
|
50
|
-
"
|
55
|
+
"input": {
|
56
|
+
"number": 4
|
57
|
+
},
|
51
58
|
"expected": "IV"
|
52
59
|
},
|
53
60
|
{
|
54
61
|
"description": "5 is a single V",
|
55
62
|
"property": "roman",
|
56
|
-
"
|
63
|
+
"input": {
|
64
|
+
"number": 5
|
65
|
+
},
|
57
66
|
"expected": "V"
|
58
67
|
},
|
59
68
|
{
|
60
69
|
"description": "6, being 5 + 1, is VI",
|
61
70
|
"property": "roman",
|
62
|
-
"
|
71
|
+
"input": {
|
72
|
+
"number": 6
|
73
|
+
},
|
63
74
|
"expected": "VI"
|
64
75
|
},
|
65
76
|
{
|
66
77
|
"description": "9, being 10 - 1, is IX",
|
67
78
|
"property": "roman",
|
68
|
-
"
|
79
|
+
"input": {
|
80
|
+
"number": 9
|
81
|
+
},
|
69
82
|
"expected": "IX"
|
70
83
|
},
|
71
84
|
{
|
72
85
|
"description": "20 is two X's",
|
73
86
|
"property": "roman",
|
74
|
-
"
|
87
|
+
"input": {
|
88
|
+
"number": 27
|
89
|
+
},
|
75
90
|
"expected": "XXVII"
|
76
91
|
},
|
77
92
|
{
|
78
93
|
"description": "48 is not 50 - 2 but rather 40 + 8",
|
79
94
|
"property": "roman",
|
80
|
-
"
|
95
|
+
"input": {
|
96
|
+
"number": 48
|
97
|
+
},
|
81
98
|
"expected": "XLVIII"
|
82
99
|
},
|
100
|
+
{
|
101
|
+
"description": "49 is not 40 + 5 + 4 but rather 50 - 10 + 10 - 1",
|
102
|
+
"property": "roman",
|
103
|
+
"input": {
|
104
|
+
"number": 49
|
105
|
+
},
|
106
|
+
"expected": "XLIX"
|
107
|
+
},
|
83
108
|
{
|
84
109
|
"description": "50 is a single L",
|
85
110
|
"property": "roman",
|
86
|
-
"
|
111
|
+
"input": {
|
112
|
+
"number": 59
|
113
|
+
},
|
87
114
|
"expected": "LIX"
|
88
115
|
},
|
89
116
|
{
|
90
117
|
"description": "90, being 100 - 10, is XC",
|
91
118
|
"property": "roman",
|
92
|
-
"
|
119
|
+
"input": {
|
120
|
+
"number": 93
|
121
|
+
},
|
93
122
|
"expected": "XCIII"
|
94
123
|
},
|
95
124
|
{
|
96
125
|
"description": "100 is a single C",
|
97
126
|
"property": "roman",
|
98
|
-
"
|
127
|
+
"input": {
|
128
|
+
"number": 141
|
129
|
+
},
|
99
130
|
"expected": "CXLI"
|
100
131
|
},
|
101
132
|
{
|
102
133
|
"description": "60, being 50 + 10, is LX",
|
103
134
|
"property": "roman",
|
104
|
-
"
|
135
|
+
"input": {
|
136
|
+
"number": 163
|
137
|
+
},
|
105
138
|
"expected": "CLXIII"
|
106
139
|
},
|
107
140
|
{
|
108
141
|
"description": "400, being 500 - 100, is CD",
|
109
142
|
"property": "roman",
|
110
|
-
"
|
143
|
+
"input": {
|
144
|
+
"number": 402
|
145
|
+
},
|
111
146
|
"expected": "CDII"
|
112
147
|
},
|
113
148
|
{
|
114
149
|
"description": "500 is a single D",
|
115
150
|
"property": "roman",
|
116
|
-
"
|
151
|
+
"input": {
|
152
|
+
"number": 575
|
153
|
+
},
|
117
154
|
"expected": "DLXXV"
|
118
155
|
},
|
119
156
|
{
|
120
157
|
"description": "900, being 1000 - 100, is CM",
|
121
158
|
"property": "roman",
|
122
|
-
"
|
159
|
+
"input": {
|
160
|
+
"number": 911
|
161
|
+
},
|
123
162
|
"expected": "CMXI"
|
124
163
|
},
|
125
164
|
{
|
126
165
|
"description": "1000 is a single M",
|
127
166
|
"property": "roman",
|
128
|
-
"
|
167
|
+
"input": {
|
168
|
+
"number": 1024
|
169
|
+
},
|
129
170
|
"expected": "MXXIV"
|
130
171
|
},
|
131
172
|
{
|
132
173
|
"description": "3000 is three M's",
|
133
174
|
"property": "roman",
|
134
|
-
"
|
175
|
+
"input": {
|
176
|
+
"number": 3000
|
177
|
+
},
|
135
178
|
"expected": "MMM"
|
136
179
|
}
|
137
180
|
]
|
138
181
|
}
|
139
|
-
|
140
182
|
=end code
|
@@ -15,82 +15,102 @@ if Scrabble.^ver !~~ $version {
|
|
15
15
|
}
|
16
16
|
|
17
17
|
my $c-data = from-json $=pod.pop.contents;
|
18
|
-
is .<input>.&score, |.<expected description> for @($c-data<cases>);
|
18
|
+
is .<input><word>.&score, |.<expected description> for @($c-data<cases>);
|
19
19
|
|
20
20
|
=head2 Canonical Data
|
21
21
|
=begin code
|
22
|
-
|
23
22
|
{
|
24
23
|
"exercise": "scrabble-score",
|
25
|
-
"version": "1.
|
24
|
+
"version": "1.1.0",
|
26
25
|
"cases": [
|
27
26
|
{
|
28
27
|
"description": "lowercase letter",
|
29
28
|
"property": "score",
|
30
|
-
"input":
|
29
|
+
"input": {
|
30
|
+
"word": "a"
|
31
|
+
},
|
31
32
|
"expected": 1
|
32
33
|
},
|
33
34
|
{
|
34
35
|
"description": "uppercase letter",
|
35
36
|
"property": "score",
|
36
|
-
"input":
|
37
|
+
"input": {
|
38
|
+
"word": "A"
|
39
|
+
},
|
37
40
|
"expected": 1
|
38
41
|
},
|
39
42
|
{
|
40
43
|
"description": "valuable letter",
|
41
44
|
"property": "score",
|
42
|
-
"input":
|
45
|
+
"input": {
|
46
|
+
"word": "f"
|
47
|
+
},
|
43
48
|
"expected": 4
|
44
49
|
},
|
45
50
|
{
|
46
51
|
"description": "short word",
|
47
52
|
"property": "score",
|
48
|
-
"input":
|
53
|
+
"input": {
|
54
|
+
"word": "at"
|
55
|
+
},
|
49
56
|
"expected": 2
|
50
57
|
},
|
51
58
|
{
|
52
59
|
"description": "short, valuable word",
|
53
60
|
"property": "score",
|
54
|
-
"input":
|
61
|
+
"input": {
|
62
|
+
"word": "zoo"
|
63
|
+
},
|
55
64
|
"expected": 12
|
56
65
|
},
|
57
66
|
{
|
58
67
|
"description": "medium word",
|
59
68
|
"property": "score",
|
60
|
-
"input":
|
69
|
+
"input": {
|
70
|
+
"word": "street"
|
71
|
+
},
|
61
72
|
"expected": 6
|
62
73
|
},
|
63
74
|
{
|
64
75
|
"description": "medium, valuable word",
|
65
76
|
"property": "score",
|
66
|
-
"input":
|
77
|
+
"input": {
|
78
|
+
"word": "quirky"
|
79
|
+
},
|
67
80
|
"expected": 22
|
68
81
|
},
|
69
82
|
{
|
70
83
|
"description": "long, mixed-case word",
|
71
84
|
"property": "score",
|
72
|
-
"input":
|
85
|
+
"input": {
|
86
|
+
"word": "OxyphenButazone"
|
87
|
+
},
|
73
88
|
"expected": 41
|
74
89
|
},
|
75
90
|
{
|
76
91
|
"description": "english-like word",
|
77
92
|
"property": "score",
|
78
|
-
"input":
|
93
|
+
"input": {
|
94
|
+
"word": "pinata"
|
95
|
+
},
|
79
96
|
"expected": 8
|
80
97
|
},
|
81
98
|
{
|
82
99
|
"description": "empty input",
|
83
100
|
"property": "score",
|
84
|
-
"input":
|
101
|
+
"input": {
|
102
|
+
"word": ""
|
103
|
+
},
|
85
104
|
"expected": 0
|
86
105
|
},
|
87
106
|
{
|
88
107
|
"description": "entire alphabet available",
|
89
108
|
"property": "score",
|
90
|
-
"input":
|
109
|
+
"input": {
|
110
|
+
"word": "abcdefghijklmnopqrstuvwxyz"
|
111
|
+
},
|
91
112
|
"expected": 87
|
92
113
|
}
|
93
114
|
]
|
94
115
|
}
|
95
|
-
|
96
116
|
=end code
|
@@ -2,7 +2,7 @@ exercise: SpaceAge
|
|
2
2
|
version: 2
|
3
3
|
plan: 8
|
4
4
|
tests: |-
|
5
|
-
is (age-on ::(.<planet>): .<seconds>), |.<expected description> for @($c-data<cases>);
|
5
|
+
is (age-on ::(.<input><planet>): .<input><seconds>), |.<expected description> for @($c-data<cases>);
|
6
6
|
|
7
7
|
unit: module
|
8
8
|
example: |-
|
@@ -15,72 +15,86 @@ if SpaceAge.^ver !~~ $version {
|
|
15
15
|
}
|
16
16
|
|
17
17
|
my $c-data = from-json $=pod.pop.contents;
|
18
|
-
is (age-on ::(.<planet>): .<seconds>), |.<expected description> for @($c-data<cases>);
|
18
|
+
is (age-on ::(.<input><planet>): .<input><seconds>), |.<expected description> for @($c-data<cases>);
|
19
19
|
|
20
20
|
=head2 Canonical Data
|
21
21
|
=begin code
|
22
|
-
|
23
22
|
{
|
24
23
|
"exercise": "space-age",
|
25
|
-
"version": "1.
|
24
|
+
"version": "1.1.0",
|
26
25
|
"cases": [
|
27
26
|
{
|
28
27
|
"description": "age on Earth",
|
29
28
|
"property": "age",
|
30
|
-
"
|
31
|
-
|
29
|
+
"input": {
|
30
|
+
"planet": "Earth",
|
31
|
+
"seconds": 1000000000
|
32
|
+
},
|
32
33
|
"expected": 31.69
|
33
34
|
},
|
34
35
|
{
|
35
36
|
"description": "age on Mercury",
|
36
37
|
"property": "age",
|
37
|
-
"
|
38
|
-
|
38
|
+
"input": {
|
39
|
+
"planet": "Mercury",
|
40
|
+
"seconds": 2134835688
|
41
|
+
},
|
39
42
|
"expected": 280.88
|
40
43
|
},
|
41
44
|
{
|
42
45
|
"description": "age on Venus",
|
43
46
|
"property": "age",
|
44
|
-
"
|
45
|
-
|
47
|
+
"input": {
|
48
|
+
"planet": "Venus",
|
49
|
+
"seconds": 189839836
|
50
|
+
},
|
46
51
|
"expected": 9.78
|
47
52
|
},
|
48
53
|
{
|
49
54
|
"description": "age on Mars",
|
50
55
|
"property": "age",
|
51
|
-
"
|
52
|
-
|
56
|
+
"input": {
|
57
|
+
"planet": "Mars",
|
58
|
+
"seconds": 2329871239
|
59
|
+
},
|
53
60
|
"expected": 39.25
|
54
61
|
},
|
55
62
|
{
|
56
63
|
"description": "age on Jupiter",
|
57
64
|
"property": "age",
|
58
|
-
"
|
59
|
-
|
65
|
+
"input": {
|
66
|
+
"planet": "Jupiter",
|
67
|
+
"seconds": 901876382
|
68
|
+
},
|
60
69
|
"expected": 2.41
|
61
70
|
},
|
62
71
|
{
|
63
72
|
"description": "age on Saturn",
|
64
73
|
"property": "age",
|
65
|
-
"
|
66
|
-
|
74
|
+
"input": {
|
75
|
+
"planet": "Saturn",
|
76
|
+
"seconds": 3000000000
|
77
|
+
},
|
67
78
|
"expected": 3.23
|
68
79
|
},
|
69
80
|
{
|
70
81
|
"description": "age on Uranus",
|
71
82
|
"property": "age",
|
72
|
-
"
|
73
|
-
|
83
|
+
"input": {
|
84
|
+
"planet": "Uranus",
|
85
|
+
"seconds": 3210123456
|
86
|
+
},
|
74
87
|
"expected": 1.21
|
75
88
|
},
|
76
89
|
{
|
77
90
|
"description": "age on Neptune",
|
78
91
|
"property": "age",
|
79
|
-
"
|
80
|
-
|
92
|
+
"input": {
|
93
|
+
"planet": "Neptune",
|
94
|
+
"seconds": 8210123456
|
95
|
+
},
|
81
96
|
"expected": 1.58
|
82
97
|
}
|
83
98
|
]
|
84
99
|
}
|
85
|
-
|
86
100
|
=end code
|