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.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/kindergarten-garden/canonical-data.json +37 -19
  4. data/problem-specifications/exercises/ocr-numbers/canonical-data.json +144 -110
  5. data/problem-specifications/exercises/palindrome-products/canonical-data.json +49 -25
  6. data/problem-specifications/exercises/poker/canonical-data.json +171 -115
  7. data/problem-specifications/exercises/prime-factors/canonical-data.json +22 -8
  8. data/problem-specifications/exercises/protein-translation/canonical-data.json +70 -24
  9. data/problem-specifications/exercises/proverb/canonical-data.json +24 -12
  10. data/problem-specifications/exercises/queen-attack/canonical-data.json +115 -91
  11. data/problem-specifications/exercises/rail-fence-cipher/canonical-data.json +25 -13
  12. data/problem-specifications/exercises/raindrops/canonical-data.json +55 -19
  13. data/problem-specifications/exercises/rational-numbers/canonical-data.json +374 -0
  14. data/problem-specifications/exercises/rational-numbers/description.md +27 -0
  15. data/problem-specifications/exercises/rational-numbers/metadata.yml +4 -0
  16. data/problem-specifications/exercises/rectangles/canonical-data.json +93 -67
  17. data/problem-specifications/exercises/reverse-string/canonical-data.json +16 -6
  18. data/problem-specifications/exercises/rna-transcription/metadata.yml +3 -3
  19. data/problem-specifications/exercises/roman-numerals/canonical-data.json +10 -2
  20. data/tracks/bash/config.json +11 -11
  21. data/tracks/c/exercises/roman-numerals/test/test_roman_numerals.c +7 -0
  22. data/tracks/clojure/exercises/armstrong-numbers/README.md +1 -1
  23. data/tracks/delphi/config.json +11 -0
  24. data/tracks/delphi/exercises/clock/uClockExample.pas +6 -1
  25. data/tracks/delphi/exercises/clock/uClockTest.pas +22 -19
  26. data/tracks/delphi/exercises/isbn-verifier/README.md +1 -1
  27. data/tracks/delphi/exercises/reverse-string/README.md +1 -1
  28. data/tracks/delphi/exercises/rna-transcription/README.md +1 -1
  29. data/tracks/delphi/exercises/roman-numerals/uRomanNumeralsTest.pas +14 -0
  30. data/tracks/delphi/exercises/space-age/README.md +45 -0
  31. data/tracks/delphi/exercises/space-age/SpaceAge.dpr +60 -0
  32. data/tracks/delphi/exercises/space-age/uSpaceAgeExample.pas +120 -0
  33. data/tracks/delphi/exercises/space-age/uSpaceAgeTests.pas +135 -0
  34. data/tracks/delphi/exercises/two-fer/README.md +1 -1
  35. data/tracks/elixir/exercises/nth-prime/nth_prime.exs +0 -1
  36. data/tracks/fsharp/exercises/pov/PovTest.fs +66 -53
  37. data/tracks/fsharp/exercises/space-age/Example.fs +11 -11
  38. data/tracks/fsharp/exercises/space-age/SpaceAge.fs +1 -1
  39. data/tracks/fsharp/exercises/space-age/SpaceAgeTest.fs +21 -34
  40. data/tracks/fsharp/exercises/triangle/Example.fs +11 -16
  41. data/tracks/fsharp/exercises/triangle/Triangle.fs +4 -5
  42. data/tracks/fsharp/exercises/triangle/TriangleTest.fs +44 -31
  43. data/tracks/fsharp/generators/Generators.fs +121 -0
  44. data/tracks/go/config.json +12 -0
  45. data/tracks/go/exercises/clock/.meta/gen.go +37 -13
  46. data/tracks/go/exercises/clock/cases_test.go +10 -10
  47. data/tracks/go/exercises/clock/clock_test.go +16 -2
  48. data/tracks/go/exercises/clock/example.go +4 -0
  49. data/tracks/go/exercises/clock/example_clock_test.go +3 -3
  50. data/tracks/go/exercises/parallel-letter-frequency/.meta/hints.md +33 -0
  51. data/tracks/go/exercises/parallel-letter-frequency/README.md +35 -0
  52. data/tracks/go/exercises/raindrops/.meta/hints.md +7 -4
  53. data/tracks/go/exercises/raindrops/README.md +12 -0
  54. data/tracks/go/exercises/roman-numerals/.meta/gen.go +4 -2
  55. data/tracks/go/exercises/roman-numerals/cases_test.go +3 -2
  56. data/tracks/go/exercises/space-age/.meta/hints.md +10 -0
  57. data/tracks/go/exercises/space-age/README.md +14 -1
  58. data/tracks/go/exercises/twelve-days/README.md +2 -5
  59. data/tracks/go/exercises/two-bucket/.meta/gen.go +62 -0
  60. data/tracks/go/exercises/two-bucket/.meta/hints.md +16 -0
  61. data/tracks/go/exercises/two-bucket/README.md +72 -0
  62. data/tracks/go/exercises/two-bucket/cases_test.go +44 -0
  63. data/tracks/go/exercises/two-bucket/example.go +198 -0
  64. data/tracks/go/exercises/two-bucket/two_bucket_test.go +61 -0
  65. data/tracks/idris/.travis.yml +3 -2
  66. data/tracks/idris/bin/fetch-idris-testing.sh +11 -0
  67. data/tracks/idris/bin/solve_exercises.sh +2 -2
  68. data/tracks/idris/config.json +11 -0
  69. data/tracks/idris/config/exercise_readme.go.tmpl +0 -3
  70. data/tracks/idris/docs/INSTALLATION.md +22 -0
  71. data/tracks/idris/docs/TESTS.md +12 -4
  72. data/tracks/idris/exercises/accumulate/src/Accumulate.idr +5 -0
  73. data/tracks/idris/exercises/hamming/Hamming.ipkg +2 -0
  74. data/tracks/idris/exercises/hamming/src/{example.idr → Example.idr} +5 -1
  75. data/tracks/idris/exercises/hamming/src/Hamming.idr +13 -5
  76. data/tracks/idris/exercises/hamming/src/Test/Hamming.idr +31 -58
  77. data/tracks/idris/exercises/hello-world/HelloWorld.ipkg +2 -0
  78. data/tracks/idris/exercises/hello-world/src/Example.idr +9 -0
  79. data/tracks/idris/exercises/hello-world/src/HelloWorld.idr +6 -1
  80. data/tracks/idris/exercises/hello-world/src/Test/HelloWorld.idr +18 -18
  81. data/tracks/idris/exercises/leap/Leap.ipkg +2 -0
  82. data/tracks/idris/exercises/leap/src/{example.idr → Example.idr} +4 -0
  83. data/tracks/idris/exercises/leap/src/Leap.idr +5 -1
  84. data/tracks/idris/exercises/leap/src/Test/Leap.idr +21 -30
  85. data/tracks/idris/exercises/rna-transcription/Makefile +23 -0
  86. data/tracks/idris/exercises/rna-transcription/README.md +27 -0
  87. data/tracks/idris/exercises/rna-transcription/RnaTranscription.ipkg +5 -0
  88. data/tracks/idris/exercises/rna-transcription/src/RnaTranscription.idr +17 -0
  89. data/tracks/idris/exercises/rna-transcription/src/Test/RnaTranscription.idr +27 -0
  90. data/tracks/idris/exercises/rna-transcription/src/example.idr +35 -0
  91. data/tracks/java/exercises/etl/.meta/version +1 -0
  92. data/tracks/java/exercises/gigasecond/.meta/version +1 -0
  93. data/tracks/java/exercises/isbn-verifier/README.md +1 -1
  94. data/tracks/java/exercises/nucleotide-count/.meta/src/reference/java/NucleotideCounter.java +7 -1
  95. data/tracks/java/exercises/nucleotide-count/.meta/version +1 -0
  96. data/tracks/java/exercises/nucleotide-count/src/test/java/NucleotideCounterTest.java +19 -54
  97. data/tracks/java/exercises/proverb/.meta/version +1 -0
  98. data/tracks/java/exercises/reverse-string/README.md +1 -1
  99. data/tracks/java/exercises/rna-transcription/README.md +1 -1
  100. data/tracks/java/exercises/sum-of-multiples/.meta/version +1 -0
  101. data/tracks/java/exercises/sum-of-multiples/src/test/java/SumOfMultiplesTest.java +13 -1
  102. data/tracks/kotlin/config/exercise_readme.go.tmpl +0 -3
  103. data/tracks/kotlin/docs/TESTS.md +1 -1
  104. data/tracks/objective-c/config.json +11 -0
  105. data/tracks/objective-c/exercises/collatz-conjecture/CollatzConjectureExample.h +7 -0
  106. data/tracks/objective-c/exercises/collatz-conjecture/CollatzConjectureExample.m +26 -0
  107. data/tracks/objective-c/exercises/collatz-conjecture/CollatzConjectureTest.m +39 -0
  108. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.pbxproj +31 -1
  109. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/OCLint.xcscheme +3 -1
  110. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/xobjectivecTest.xcscheme +3 -1
  111. data/tracks/ocaml/exercises/forth/example.ml +9 -9
  112. data/tracks/ocaml/tools/test-generator/Makefile +3 -9
  113. data/tracks/ocaml/tools/test-generator/src/test_gen.ml +18 -16
  114. data/tracks/perl6/exercises/acronym/.meta/exercise-data.yaml +1 -1
  115. data/tracks/perl6/exercises/acronym/acronym.t +4 -14
  116. data/tracks/perl6/exercises/all-your-base/all-your-base.t +0 -2
  117. data/tracks/perl6/exercises/allergies/allergies.t +0 -2
  118. data/tracks/perl6/exercises/anagram/.meta/exercise-data.yaml +1 -1
  119. data/tracks/perl6/exercises/anagram/anagram.t +2 -40
  120. data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +0 -1
  121. data/tracks/perl6/exercises/bob/bob.t +0 -2
  122. data/tracks/perl6/exercises/clock/.meta/exercise-data.yaml +15 -11
  123. data/tracks/perl6/exercises/clock/.meta/solutions/Clock.pm6 +5 -1
  124. data/tracks/perl6/exercises/clock/Clock.pm6 +1 -1
  125. data/tracks/perl6/exercises/clock/clock.t +314 -217
  126. data/tracks/perl6/exercises/etl/etl.t +0 -2
  127. data/tracks/perl6/exercises/flatten-array/flatten-array.t +0 -2
  128. data/tracks/perl6/exercises/grains/grains.t +0 -2
  129. data/tracks/perl6/exercises/hamming/.meta/exercise-data.yaml +2 -2
  130. data/tracks/perl6/exercises/hamming/hamming.t +63 -35
  131. data/tracks/perl6/exercises/hello-world/hello-world.t +2 -3
  132. data/tracks/perl6/exercises/leap/.meta/exercise-data.yaml +1 -1
  133. data/tracks/perl6/exercises/leap/leap.t +14 -8
  134. data/tracks/perl6/exercises/luhn/luhn.t +0 -2
  135. data/tracks/perl6/exercises/nucleotide-count/.meta/exercise-data.yaml +2 -2
  136. data/tracks/perl6/exercises/nucleotide-count/nucleotide-count.t +18 -10
  137. data/tracks/perl6/exercises/pangram/.meta/exercise-data.yaml +1 -1
  138. data/tracks/perl6/exercises/pangram/pangram.t +32 -14
  139. data/tracks/perl6/exercises/phone-number/.meta/exercise-data.yaml +4 -4
  140. data/tracks/perl6/exercises/phone-number/.meta/solutions/Phone.pm6 +1 -1
  141. data/tracks/perl6/exercises/phone-number/Phone.pm6 +1 -1
  142. data/tracks/perl6/exercises/phone-number/phone-number.t +59 -21
  143. data/tracks/perl6/exercises/raindrops/raindrops.t +0 -2
  144. data/tracks/perl6/exercises/rna-transcription/.meta/exercise-data.yaml +1 -1
  145. data/tracks/perl6/exercises/rna-transcription/README.md +1 -1
  146. data/tracks/perl6/exercises/rna-transcription/rna-transcription.t +17 -9
  147. data/tracks/perl6/exercises/roman-numerals/.meta/exercise-data.yaml +3 -3
  148. data/tracks/perl6/exercises/roman-numerals/.meta/solutions/RomanNumerals.pm6 +1 -1
  149. data/tracks/perl6/exercises/roman-numerals/RomanNumerals.pm6 +1 -1
  150. data/tracks/perl6/exercises/roman-numerals/roman-numerals.t +66 -24
  151. data/tracks/perl6/exercises/scrabble-score/.meta/exercise-data.yaml +1 -1
  152. data/tracks/perl6/exercises/scrabble-score/scrabble-score.t +35 -15
  153. data/tracks/perl6/exercises/space-age/.meta/exercise-data.yaml +1 -1
  154. data/tracks/perl6/exercises/space-age/space-age.t +34 -20
  155. data/tracks/perl6/exercises/two-fer/.meta/exercise-data.yaml +2 -2
  156. data/tracks/perl6/exercises/two-fer/two-fer.t +15 -11
  157. data/tracks/perl6/exercises/word-count/.meta/exercise-data.yaml +1 -1
  158. data/tracks/perl6/exercises/word-count/word-count.t +46 -26
  159. data/tracks/perl6/exercises/wordy/.meta/exercise-data.yaml +2 -2
  160. data/tracks/perl6/exercises/wordy/wordy.t +51 -21
  161. data/tracks/perl6/lib/Exercism/Generator.pm6 +1 -1
  162. data/tracks/perl6/t/generated-tests.t +1 -1
  163. data/tracks/perl6/templates/test.mustache +0 -1
  164. data/tracks/python/config.json +12 -0
  165. data/tracks/python/exercises/forth/example.py +1 -1
  166. data/tracks/python/exercises/forth/forth_test.py +43 -38
  167. data/tracks/python/exercises/spiral-matrix/README.md +42 -0
  168. data/tracks/python/exercises/spiral-matrix/example.py +11 -0
  169. data/tracks/python/exercises/spiral-matrix/spiral_matrix.py +2 -0
  170. data/tracks/python/exercises/spiral-matrix/spiral_matrix_test.py +40 -0
  171. data/tracks/racket/config/exercise_readme.go.tmpl +24 -4
  172. data/tracks/racket/exercises/accumulate/README.md +3 -6
  173. data/tracks/racket/exercises/acronym/README.md +3 -4
  174. data/tracks/racket/exercises/allergies/README.md +3 -4
  175. data/tracks/racket/exercises/anagram/README.md +3 -3
  176. data/tracks/racket/exercises/bob/README.md +5 -3
  177. data/tracks/racket/exercises/collatz-conjecture/README.md +3 -3
  178. data/tracks/racket/exercises/difference-of-squares/README.md +3 -3
  179. data/tracks/racket/exercises/etl/README.md +6 -4
  180. data/tracks/racket/exercises/gigasecond/README.md +3 -3
  181. data/tracks/racket/exercises/grains/README.md +3 -4
  182. data/tracks/racket/exercises/grep/README.md +15 -15
  183. data/tracks/racket/exercises/hamming/README.md +3 -3
  184. data/tracks/racket/exercises/hello-world/README.md +1 -1
  185. data/tracks/racket/exercises/leap/README.md +4 -4
  186. data/tracks/racket/exercises/list-ops/README.md +3 -4
  187. data/tracks/racket/exercises/meetup/README.md +19 -15
  188. data/tracks/racket/exercises/nucleotide-count/README.md +11 -25
  189. data/tracks/racket/exercises/perfect-numbers/README.md +5 -5
  190. data/tracks/racket/exercises/phone-number/README.md +7 -6
  191. data/tracks/racket/exercises/raindrops/README.md +3 -3
  192. data/tracks/racket/exercises/rna-transcription/README.md +4 -4
  193. data/tracks/racket/exercises/roman-numerals/README.md +4 -4
  194. data/tracks/racket/exercises/say/README.md +3 -3
  195. data/tracks/racket/exercises/scrabble-score/README.md +6 -4
  196. data/tracks/racket/exercises/word-count/README.md +4 -5
  197. data/tracks/scheme/config/exercise_readme.go.tmpl +0 -3
  198. data/tracks/scheme/docs/INSTALLATION.md +23 -14
  199. metadata +40 -9
  200. data/tracks/idris/docs/EXERCISE_README_INSERT.md +0 -0
  201. data/tracks/idris/exercises/hello-world/src/example.idr +0 -5
  202. data/tracks/kotlin/config/exercise-readme-insert.md +0 -1
  203. data/tracks/racket/docs/EXERCISE_README_INSERT.md +0 -23
  204. data/tracks/scheme/docs/EXERCISE_README_INSERT.md +0 -0
@@ -1,4 +1,4 @@
1
- unit module RomanNumerals:ver<2>;
1
+ unit module RomanNumerals:ver<3>;
2
2
 
3
3
  sub to-roman ($number) is export {
4
4
  }
@@ -4,9 +4,9 @@ use Test;
4
4
  use JSON::Fast;
5
5
  use lib $?FILE.IO.dirname;
6
6
  use RomanNumerals;
7
- plan 18;
7
+ plan 19;
8
8
 
9
- my Version:D $version = v2;
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.0.0",
26
+ "version": "1.2.0",
28
27
  "cases": [
29
28
  {
30
29
  "description": "1 is a single I",
31
30
  "property": "roman",
32
- "number": 1,
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
- "number": 2,
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
- "number": 3,
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
- "number": 4,
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
- "number": 5,
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
- "number": 6,
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
- "number": 9,
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
- "number": 27,
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
- "number": 48,
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
- "number": 59,
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
- "number": 93,
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
- "number": 141,
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
- "number": 163,
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
- "number": 402,
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
- "number": 575,
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
- "number": 911,
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
- "number": 1024,
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
- "number": 3000,
175
+ "input": {
176
+ "number": 3000
177
+ },
135
178
  "expected": "MMM"
136
179
  }
137
180
  ]
138
181
  }
139
-
140
182
  =end code
@@ -2,7 +2,7 @@ exercise: Scrabble
2
2
  version: 2
3
3
  plan: 11
4
4
  tests: |-
5
- is .<input>.&score, |.<expected description> for @($c-data<cases>);
5
+ is .<input><word>.&score, |.<expected description> for @($c-data<cases>);
6
6
 
7
7
  unit: module
8
8
  example: |-
@@ -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.0.0",
24
+ "version": "1.1.0",
26
25
  "cases": [
27
26
  {
28
27
  "description": "lowercase letter",
29
28
  "property": "score",
30
- "input": "a",
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": "A",
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": "f",
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": "at",
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": "zoo",
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": "street",
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": "quirky",
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": "OxyphenButazone",
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": "pinata",
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": "abcdefghijklmnopqrstuvwxyz",
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.0.0",
24
+ "version": "1.1.0",
26
25
  "cases": [
27
26
  {
28
27
  "description": "age on Earth",
29
28
  "property": "age",
30
- "planet": "Earth",
31
- "seconds": 1000000000,
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
- "planet": "Mercury",
38
- "seconds": 2134835688,
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
- "planet": "Venus",
45
- "seconds": 189839836,
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
- "planet": "Mars",
52
- "seconds": 2329871239,
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
- "planet": "Jupiter",
59
- "seconds": 901876382,
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
- "planet": "Saturn",
66
- "seconds": 3000000000,
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
- "planet": "Uranus",
73
- "seconds": 3210123456,
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
- "planet": "Neptune",
80
- "seconds": 8210123456,
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