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
@@ -35,7 +35,6 @@ for $c-data<cases>.values -> %case-set {
35
35
 
36
36
  =head2 Canonical Data
37
37
  =begin code
38
-
39
38
  {
40
39
  "exercise": "etl",
41
40
  "version": "1.0.0",
@@ -113,5 +112,4 @@ for $c-data<cases>.values -> %case-set {
113
112
  }
114
113
  ]
115
114
  }
116
-
117
115
  =end code
@@ -19,7 +19,6 @@ is-deeply flatten-array(.<input><array>), |.<expected description> for @($c-data
19
19
 
20
20
  =head2 Canonical Data
21
21
  =begin code
22
-
23
22
  {
24
23
  "exercise": "flatten-array",
25
24
  "version": "1.2.0",
@@ -74,5 +73,4 @@ is-deeply flatten-array(.<input><array>), |.<expected description> for @($c-data
74
73
  }
75
74
  ]
76
75
  }
77
-
78
76
  =end code
@@ -26,7 +26,6 @@ is total-grains, |$c-data<cases>[1]<expected description>;
26
26
 
27
27
  =head2 Canonical Data
28
28
  =begin code
29
-
30
29
  {
31
30
  "exercise": "grains",
32
31
  "version": "1.0.0",
@@ -108,5 +107,4 @@ is total-grains, |$c-data<cases>[1]<expected description>;
108
107
  }
109
108
  ]
110
109
  }
111
-
112
110
  =end code
@@ -4,9 +4,9 @@ plan: 15
4
4
  tests: |-
5
5
  for $c-data<cases>.values {
6
6
  if .<expected><error> {
7
- throws-like {hamming-distance(|.<strand1 strand2>)}, Exception, .<description>;
7
+ throws-like {hamming-distance(|.<input><strand1 strand2>)}, Exception, .<description>;
8
8
  } else {
9
- is hamming-distance(|.<strand1 strand2>), |.<expected description>;
9
+ is hamming-distance(|.<input><strand1 strand2>), |.<expected description>;
10
10
  }
11
11
  }
12
12
 
@@ -17,18 +17,17 @@ if Hamming.^ver !~~ $version {
17
17
  my $c-data = from-json $=pod.pop.contents;
18
18
  for $c-data<cases>.values {
19
19
  if .<expected><error> {
20
- throws-like {hamming-distance(|.<strand1 strand2>)}, Exception, .<description>;
20
+ throws-like {hamming-distance(|.<input><strand1 strand2>)}, Exception, .<description>;
21
21
  } else {
22
- is hamming-distance(|.<strand1 strand2>), |.<expected description>;
22
+ is hamming-distance(|.<input><strand1 strand2>), |.<expected description>;
23
23
  }
24
24
  }
25
25
 
26
26
  =head2 Canonical Data
27
27
  =begin code
28
-
29
28
  {
30
29
  "exercise": "hamming",
31
- "version": "2.0.1",
30
+ "version": "2.1.0",
32
31
  "comments": [
33
32
  "Language implementations vary on the issue of unequal length strands.",
34
33
  "A language may elect to simplify this task by only presenting equal",
@@ -45,109 +44,138 @@ for $c-data<cases>.values {
45
44
  {
46
45
  "description": "empty strands",
47
46
  "property": "distance",
48
- "strand1": "",
49
- "strand2": "",
47
+ "input": {
48
+ "strand1": "",
49
+ "strand2": ""
50
+ },
50
51
  "expected": 0
51
52
  },
52
53
  {
53
54
  "description": "identical strands",
54
55
  "property": "distance",
55
- "strand1": "A",
56
- "strand2": "A",
56
+ "input": {
57
+ "strand1": "A",
58
+ "strand2": "A"
59
+ },
57
60
  "expected": 0
58
61
  },
59
62
  {
60
63
  "description": "long identical strands",
61
64
  "property": "distance",
62
- "strand1": "GGACTGA",
63
- "strand2": "GGACTGA",
65
+ "input": {
66
+ "strand1": "GGACTGA",
67
+ "strand2": "GGACTGA"
68
+ },
64
69
  "expected": 0
65
70
  },
66
71
  {
67
72
  "description": "complete distance in single nucleotide strands",
68
73
  "property": "distance",
69
- "strand1": "A",
70
- "strand2": "G",
74
+ "input": {
75
+ "strand1": "A",
76
+ "strand2": "G"
77
+ },
71
78
  "expected": 1
72
79
  },
73
80
  {
74
81
  "description": "complete distance in small strands",
75
82
  "property": "distance",
76
- "strand1": "AG",
77
- "strand2": "CT",
83
+ "input": {
84
+ "strand1": "AG",
85
+ "strand2": "CT"
86
+ },
78
87
  "expected": 2
79
88
  },
80
89
  {
81
90
  "description": "small distance in small strands",
82
91
  "property": "distance",
83
- "strand1": "AT",
84
- "strand2": "CT",
92
+ "input": {
93
+ "strand1": "AT",
94
+ "strand2": "CT"
95
+ },
85
96
  "expected": 1
86
97
  },
87
98
  {
88
99
  "description": "small distance",
89
100
  "property": "distance",
90
- "strand1": "GGACG",
91
- "strand2": "GGTCG",
101
+ "input": {
102
+ "strand1": "GGACG",
103
+ "strand2": "GGTCG"
104
+ },
92
105
  "expected": 1
93
106
  },
94
107
  {
95
108
  "description": "small distance in long strands",
96
109
  "property": "distance",
97
- "strand1": "ACCAGGG",
98
- "strand2": "ACTATGG",
110
+ "input": {
111
+ "strand1": "ACCAGGG",
112
+ "strand2": "ACTATGG"
113
+ },
99
114
  "expected": 2
100
115
  },
101
116
  {
102
117
  "description": "non-unique character in first strand",
103
118
  "property": "distance",
104
- "strand1": "AAG",
105
- "strand2": "AAA",
119
+ "input": {
120
+ "strand1": "AAG",
121
+ "strand2": "AAA"
122
+ },
106
123
  "expected": 1
107
124
  },
108
125
  {
109
126
  "description": "non-unique character in second strand",
110
127
  "property": "distance",
111
- "strand1": "AAA",
112
- "strand2": "AAG",
128
+ "input": {
129
+ "strand1": "AAA",
130
+ "strand2": "AAG"
131
+ },
113
132
  "expected": 1
114
133
  },
115
134
  {
116
135
  "description": "same nucleotides in different positions",
117
136
  "property": "distance",
118
- "strand1": "TAG",
119
- "strand2": "GAT",
137
+ "input": {
138
+ "strand1": "TAG",
139
+ "strand2": "GAT"
140
+ },
120
141
  "expected": 2
121
142
  },
122
143
  {
123
144
  "description": "large distance",
124
145
  "property": "distance",
125
- "strand1": "GATACA",
126
- "strand2": "GCATAA",
146
+ "input": {
147
+ "strand1": "GATACA",
148
+ "strand2": "GCATAA"
149
+ },
127
150
  "expected": 4
128
151
  },
129
152
  {
130
153
  "description": "large distance in off-by-one strand",
131
154
  "property": "distance",
132
- "strand1": "GGACGGATTCTG",
133
- "strand2": "AGGACGGATTCT",
155
+ "input": {
156
+ "strand1": "GGACGGATTCTG",
157
+ "strand2": "AGGACGGATTCT"
158
+ },
134
159
  "expected": 9
135
160
  },
136
161
  {
137
162
  "description": "disallow first strand longer",
138
163
  "property": "distance",
139
- "strand1": "AATG",
140
- "strand2": "AAA",
164
+ "input": {
165
+ "strand1": "AATG",
166
+ "strand2": "AAA"
167
+ },
141
168
  "expected": {"error": "left and right strands must be of equal length"}
142
169
  },
143
170
  {
144
171
  "description": "disallow second strand longer",
145
172
  "property": "distance",
146
- "strand1": "ATA",
147
- "strand2": "AGTG",
173
+ "input": {
174
+ "strand1": "ATA",
175
+ "strand2": "AGTG"
176
+ },
148
177
  "expected": {"error": "left and right strands must be of equal length"}
149
178
  }
150
179
  ]
151
180
  }
152
-
153
181
  =end code
@@ -22,17 +22,16 @@ is hello, |.<expected description> for @($c-data<cases>);
22
22
 
23
23
  =head2 Canonical Data
24
24
  =begin code
25
-
26
25
  {
27
26
  "exercise": "hello-world",
28
- "version": "1.0.0",
27
+ "version": "1.1.0",
29
28
  "cases": [
30
29
  {
31
30
  "description": "Say Hi!",
32
31
  "property": "hello",
32
+ "input": {},
33
33
  "expected": "Hello, World!"
34
34
  }
35
35
  ]
36
36
  }
37
-
38
37
  =end code
@@ -3,7 +3,7 @@ version: 4
3
3
  plan: 4
4
4
  tests: |-
5
5
  for $c-data<cases>.values {
6
- given is-leap-year .<input> -> $result {
6
+ given is-leap-year .<input><year> -> $result {
7
7
  subtest .<description>, {
8
8
  plan 2;
9
9
  isa-ok $result, Bool;
@@ -16,7 +16,7 @@ if Leap.^ver !~~ $version {
16
16
 
17
17
  my $c-data = from-json $=pod.pop.contents;
18
18
  for $c-data<cases>.values {
19
- given is-leap-year .<input> -> $result {
19
+ given is-leap-year .<input><year> -> $result {
20
20
  subtest .<description>, {
21
21
  plan 2;
22
22
  isa-ok $result, Bool;
@@ -27,36 +27,42 @@ for $c-data<cases>.values {
27
27
 
28
28
  =head2 Canonical Data
29
29
  =begin code
30
-
31
30
  {
32
31
  "exercise": "leap",
33
- "version": "1.2.0",
32
+ "version": "1.3.0",
34
33
  "cases": [
35
34
  {
36
35
  "description": "year not divisible by 4: common year",
37
36
  "property": "leapYear",
38
- "input": 2015,
37
+ "input": {
38
+ "year": 2015
39
+ },
39
40
  "expected": false
40
41
  },
41
42
  {
42
43
  "description": "year divisible by 4, not divisible by 100: leap year",
43
44
  "property": "leapYear",
44
- "input": 1996,
45
+ "input": {
46
+ "year": 1996
47
+ },
45
48
  "expected": true
46
49
  },
47
50
  {
48
51
  "description": "year divisible by 100, not divisible by 400: common year",
49
52
  "property": "leapYear",
50
- "input": 2100,
53
+ "input": {
54
+ "year": 2100
55
+ },
51
56
  "expected": false
52
57
  },
53
58
  {
54
59
  "description": "year divisible by 400: leap year",
55
60
  "property": "leapYear",
56
- "input": 2000,
61
+ "input": {
62
+ "year": 2000
63
+ },
57
64
  "expected": true
58
65
  }
59
66
  ]
60
67
  }
61
-
62
68
  =end code
@@ -27,7 +27,6 @@ for $c-data<cases>.values {
27
27
 
28
28
  =head2 Canonical Data
29
29
  =begin code
30
-
31
30
  {
32
31
  "exercise": "luhn",
33
32
  "version": "1.1.0",
@@ -138,5 +137,4 @@ for $c-data<cases>.values {
138
137
  }
139
138
  ]
140
139
  }
141
-
142
140
  =end code
@@ -4,10 +4,10 @@ plan: 5
4
4
  tests: |-
5
5
  for $c-data<cases>».<cases>».Array.flat {
6
6
  if .<expected><error> {
7
- throws-like {nucleotide-count(.<strand>)}, Exception, .<description>;
7
+ throws-like {nucleotide-count(.<input><strand>)}, Exception, .<description>;
8
8
  }
9
9
  else {
10
- cmp-ok nucleotide-count(.<strand>), '~~', .<expected>.Bag, .<description>;
10
+ cmp-ok nucleotide-count(.<input><strand>), '~~', .<expected>.Bag, .<description>;
11
11
  }
12
12
  }
13
13
 
@@ -17,19 +17,18 @@ if NucleotideCount.^ver !~~ $version {
17
17
  my $c-data = from-json $=pod.pop.contents;
18
18
  for $c-data<cases>».<cases>».Array.flat {
19
19
  if .<expected><error> {
20
- throws-like {nucleotide-count(.<strand>)}, Exception, .<description>;
20
+ throws-like {nucleotide-count(.<input><strand>)}, Exception, .<description>;
21
21
  }
22
22
  else {
23
- cmp-ok nucleotide-count(.<strand>), '~~', .<expected>.Bag, .<description>;
23
+ cmp-ok nucleotide-count(.<input><strand>), '~~', .<expected>.Bag, .<description>;
24
24
  }
25
25
  }
26
26
 
27
27
  =head2 Canonical Data
28
28
  =begin code
29
-
30
29
  {
31
30
  "exercise": "nucleotide-count",
32
- "version": "1.2.0",
31
+ "version": "1.3.0",
33
32
  "cases": [
34
33
  {
35
34
  "description": "count all nucleotides in a strand",
@@ -37,7 +36,9 @@ for $c-data<cases>».<cases>».Array.flat {
37
36
  {
38
37
  "description": "empty strand",
39
38
  "property": "nucleotideCounts",
40
- "strand": "",
39
+ "input": {
40
+ "strand": ""
41
+ },
41
42
  "expected": {
42
43
  "A": 0,
43
44
  "C": 0,
@@ -48,7 +49,9 @@ for $c-data<cases>».<cases>».Array.flat {
48
49
  {
49
50
  "description": "can count one nucleotide in single-character input",
50
51
  "property": "nucleotideCounts",
51
- "strand": "G",
52
+ "input": {
53
+ "strand": "G"
54
+ },
52
55
  "expected": {
53
56
  "A": 0,
54
57
  "C": 0,
@@ -59,7 +62,9 @@ for $c-data<cases>».<cases>».Array.flat {
59
62
  {
60
63
  "description": "strand with repeated nucleotide",
61
64
  "property": "nucleotideCounts",
62
- "strand": "GGGGGGG",
65
+ "input": {
66
+ "strand": "GGGGGGG"
67
+ },
63
68
  "expected": {
64
69
  "A": 0,
65
70
  "C": 0,
@@ -70,7 +75,9 @@ for $c-data<cases>».<cases>».Array.flat {
70
75
  {
71
76
  "description": "strand with multiple nucleotides",
72
77
  "property": "nucleotideCounts",
73
- "strand": "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC",
78
+ "input": {
79
+ "strand": "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC"
80
+ },
74
81
  "expected": {
75
82
  "A": 20,
76
83
  "C": 12,
@@ -81,7 +88,9 @@ for $c-data<cases>».<cases>».Array.flat {
81
88
  {
82
89
  "description": "strand with invalid nucleotides",
83
90
  "property": "nucleotideCounts",
84
- "strand": "AGXXACT",
91
+ "input": {
92
+ "strand": "AGXXACT"
93
+ },
85
94
  "expected": {
86
95
  "error": "Invalid nucleotide in strand"
87
96
  }
@@ -90,5 +99,4 @@ for $c-data<cases>».<cases>».Array.flat {
90
99
  }
91
100
  ]
92
101
  }
93
-
94
102
  =end code