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
@@ -4,8 +4,8 @@ plan: 3
4
4
  tests: |-
5
5
  # Go through the cases and check that &two-fer gives us the correct response.
6
6
  for $c-data<cases>.values {
7
- is .<input> ??
8
- two-fer(.<input>) !!
7
+ is .<input><name> ??
8
+ two-fer(.<input><name>) !!
9
9
  two-fer,
10
10
  |.<expected description>;
11
11
  }
@@ -19,38 +19,42 @@ if TwoFer.^ver !~~ $version {
19
19
  my $c-data = from-json $=pod.pop.contents;
20
20
  # Go through the cases and check that &two-fer gives us the correct response.
21
21
  for $c-data<cases>.values {
22
- is .<input> ??
23
- two-fer(.<input>) !!
22
+ is .<input><name> ??
23
+ two-fer(.<input><name>) !!
24
24
  two-fer,
25
25
  |.<expected description>;
26
26
  }
27
27
 
28
28
  =head2 Canonical Data
29
29
  =begin code
30
-
31
30
  {
32
31
  "exercise": "two-fer",
33
- "version": "1.1.0",
32
+ "version": "1.2.0",
34
33
  "cases": [
35
34
  {
36
35
  "description": "no name given",
37
- "property": "name",
38
- "input": null,
36
+ "property": "twoFer",
37
+ "input": {
38
+ "name": null
39
+ },
39
40
  "expected": "One for you, one for me."
40
41
  },
41
42
  {
42
43
  "description": "a name given",
43
- "property": "name",
44
- "input": "Alice",
44
+ "property": "twoFer",
45
+ "input": {
46
+ "name": "Alice"
47
+ },
45
48
  "expected": "One for Alice, one for me."
46
49
  },
47
50
  {
48
51
  "description": "another name given",
49
- "property": "name",
50
- "input": "Bob",
52
+ "property": "twoFer",
53
+ "input": {
54
+ "name": "Bob"
55
+ },
51
56
  "expected": "One for Bob, one for me."
52
57
  }
53
58
  ]
54
59
  }
55
-
56
60
  =end code
@@ -2,7 +2,7 @@ exercise: WordCount
2
2
  version: 3
3
3
  plan: 11
4
4
  tests: |-
5
- is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<cases>);
5
+ is-deeply (% = .<input><sentence>.&count-words), |.<expected description> for @($c-data<cases>);
6
6
 
7
7
  unit: module
8
8
  example: |-
@@ -15,14 +15,13 @@ if WordCount.^ver !~~ $version {
15
15
  }
16
16
 
17
17
  my $c-data = from-json $=pod.pop.contents;
18
- is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<cases>);
18
+ is-deeply (% = .<input><sentence>.&count-words), |.<expected description> for @($c-data<cases>);
19
19
 
20
20
  =head2 Canonical Data
21
21
  =begin code
22
-
23
22
  {
24
23
  "exercise": "word-count",
25
- "version": "1.0.0",
24
+ "version": "1.2.0",
26
25
  "comments": [
27
26
  "For each word in the input, count the number of times it appears in the",
28
27
  "entire sentence."
@@ -30,16 +29,20 @@ is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<ca
30
29
  "cases": [
31
30
  {
32
31
  "description": "count one word",
33
- "property": "countwords",
34
- "input": "word",
32
+ "property": "countWords",
33
+ "input": {
34
+ "sentence": "word"
35
+ },
35
36
  "expected": {
36
37
  "word": 1
37
38
  }
38
39
  },
39
40
  {
40
41
  "description": "count one of each word",
41
- "property": "countwords",
42
- "input": "one of each",
42
+ "property": "countWords",
43
+ "input": {
44
+ "sentence": "one of each"
45
+ },
43
46
  "expected": {
44
47
  "one": 1,
45
48
  "of": 1,
@@ -48,8 +51,10 @@ is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<ca
48
51
  },
49
52
  {
50
53
  "description": "multiple occurrences of a word",
51
- "property": "countwords",
52
- "input": "one fish two fish red fish blue fish",
54
+ "property": "countWords",
55
+ "input": {
56
+ "sentence": "one fish two fish red fish blue fish"
57
+ },
53
58
  "expected": {
54
59
  "one": 1,
55
60
  "fish": 4,
@@ -60,8 +65,10 @@ is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<ca
60
65
  },
61
66
  {
62
67
  "description": "handles cramped lists",
63
- "property": "countwords",
64
- "input": "one,two,three",
68
+ "property": "countWords",
69
+ "input": {
70
+ "sentence": "one,two,three"
71
+ },
65
72
  "expected": {
66
73
  "one": 1,
67
74
  "two": 1,
@@ -70,8 +77,10 @@ is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<ca
70
77
  },
71
78
  {
72
79
  "description": "handles expanded lists",
73
- "property": "countwords",
74
- "input": "one,\ntwo,\nthree",
80
+ "property": "countWords",
81
+ "input": {
82
+ "sentence": "one,\ntwo,\nthree"
83
+ },
75
84
  "expected": {
76
85
  "one": 1,
77
86
  "two": 1,
@@ -80,8 +89,10 @@ is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<ca
80
89
  },
81
90
  {
82
91
  "description": "ignore punctuation",
83
- "property": "countwords",
84
- "input": "car: carpet as java: javascript!!&@$%^&",
92
+ "property": "countWords",
93
+ "input": {
94
+ "sentence": "car: carpet as java: javascript!!&@$%^&"
95
+ },
85
96
  "expected": {
86
97
  "car": 1,
87
98
  "carpet": 1,
@@ -92,8 +103,10 @@ is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<ca
92
103
  },
93
104
  {
94
105
  "description": "include numbers",
95
- "property": "countwords",
96
- "input": "testing, 1, 2 testing",
106
+ "property": "countWords",
107
+ "input": {
108
+ "sentence": "testing, 1, 2 testing"
109
+ },
97
110
  "expected": {
98
111
  "testing": 2,
99
112
  "1": 1,
@@ -102,8 +115,10 @@ is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<ca
102
115
  },
103
116
  {
104
117
  "description": "normalize case",
105
- "property": "countwords",
106
- "input": "go Go GO Stop stop",
118
+ "property": "countWords",
119
+ "input": {
120
+ "sentence": "go Go GO Stop stop"
121
+ },
107
122
  "expected": {
108
123
  "go": 3,
109
124
  "stop": 2
@@ -111,8 +126,10 @@ is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<ca
111
126
  },
112
127
  {
113
128
  "description": "with apostrophes",
114
- "property": "countwords",
115
- "input": "First: don't laugh. Then: don't cry.",
129
+ "property": "countWords",
130
+ "input": {
131
+ "sentence": "First: don't laugh. Then: don't cry."
132
+ },
116
133
  "expected": {
117
134
  "first": 1,
118
135
  "don't": 2,
@@ -123,8 +140,10 @@ is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<ca
123
140
  },
124
141
  {
125
142
  "description": "with quotations",
126
- "property": "countwords",
127
- "input": "Joe can't tell between 'large' and large.",
143
+ "property": "countWords",
144
+ "input": {
145
+ "sentence": "Joe can't tell between 'large' and large."
146
+ },
128
147
  "expected": {
129
148
  "joe": 1,
130
149
  "can't": 1,
@@ -136,8 +155,10 @@ is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<ca
136
155
  },
137
156
  {
138
157
  "description": "multiple spaces not detected as a word",
139
- "property": "countwords",
140
- "input": " multiple whitespaces",
158
+ "property": "countWords",
159
+ "input": {
160
+ "sentence": " multiple whitespaces"
161
+ },
141
162
  "expected": {
142
163
  "multiple": 1,
143
164
  "whitespaces": 1
@@ -145,5 +166,4 @@ is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<ca
145
166
  }
146
167
  ]
147
168
  }
148
-
149
169
  =end code
@@ -4,9 +4,9 @@ plan: 16
4
4
  tests: |-
5
5
  for @($c-data<cases>) {
6
6
  if .<expected> === False {
7
- throws-like {.<input>.&answer}, Exception, .<description>;
7
+ throws-like {.<input><question>.&answer}, Exception, .<description>;
8
8
  } else {
9
- is .<input>.&answer, |.<expected description>;
9
+ is .<input><question>.&answer, |.<expected description>;
10
10
  }
11
11
  }
12
12
 
@@ -17,18 +17,17 @@ if Wordy.^ver !~~ $version {
17
17
  my $c-data = from-json $=pod.pop.contents;
18
18
  for @($c-data<cases>) {
19
19
  if .<expected> === False {
20
- throws-like {.<input>.&answer}, Exception, .<description>;
20
+ throws-like {.<input><question>.&answer}, Exception, .<description>;
21
21
  } else {
22
- is .<input>.&answer, |.<expected description>;
22
+ is .<input><question>.&answer, |.<expected description>;
23
23
  }
24
24
  }
25
25
 
26
26
  =head2 Canonical Data
27
27
  =begin code
28
-
29
28
  {
30
29
  "exercise": "wordy",
31
- "version": "1.0.0",
30
+ "version": "1.1.0",
32
31
  "comments": [
33
32
  "The tests that expect 'false' should be implemented to raise",
34
33
  "an error, or indicate a failure. Implement this in a way that",
@@ -38,100 +37,131 @@ for @($c-data<cases>) {
38
37
  {
39
38
  "description": "addition",
40
39
  "property": "answer",
41
- "input": "What is 1 plus 1?",
40
+ "input": {
41
+ "question": "What is 1 plus 1?"
42
+ },
42
43
  "expected": 2
43
44
  },
44
45
  {
45
46
  "description": "more addition",
46
47
  "property": "answer",
47
- "input": "What is 53 plus 2?",
48
+ "input": {
49
+ "question": "What is 53 plus 2?"
50
+ },
48
51
  "expected": 55
49
52
  },
50
53
  {
51
54
  "description": "addition with negative numbers",
52
55
  "property": "answer",
53
- "input": "What is -1 plus -10?",
56
+ "input": {
57
+ "question": "What is -1 plus -10?"
58
+ },
54
59
  "expected": -11
55
60
  },
56
61
  {
57
62
  "description": "large addition",
58
63
  "property": "answer",
59
- "input": "What is 123 plus 45678?",
64
+ "input": {
65
+ "question": "What is 123 plus 45678?"
66
+ },
60
67
  "expected": 45801
61
68
  },
62
69
  {
63
70
  "description": "subtraction",
64
71
  "property": "answer",
65
- "input": "What is 4 minus -12?",
72
+ "input": {
73
+ "question": "What is 4 minus -12?"
74
+ },
66
75
  "expected": 16
67
76
  },
68
77
  {
69
78
  "description": "multiplication",
70
79
  "property": "answer",
71
- "input": "What is -3 multiplied by 25?",
80
+ "input": {
81
+ "question": "What is -3 multiplied by 25?"
82
+ },
72
83
  "expected": -75
73
84
  },
74
85
  {
75
86
  "description": "division",
76
87
  "property": "answer",
77
- "input": "What is 33 divided by -3?",
88
+ "input": {
89
+ "question": "What is 33 divided by -3?"
90
+ },
78
91
  "expected": -11
79
92
  },
80
93
  {
81
94
  "description": "multiple additions",
82
95
  "property": "answer",
83
- "input": "What is 1 plus 1 plus 1?",
96
+ "input": {
97
+ "question": "What is 1 plus 1 plus 1?"
98
+ },
84
99
  "expected": 3
85
100
  },
86
101
  {
87
102
  "description": "addition and subtraction",
88
103
  "property": "answer",
89
- "input": "What is 1 plus 5 minus -2?",
104
+ "input": {
105
+ "question": "What is 1 plus 5 minus -2?"
106
+ },
90
107
  "expected": 8
91
108
  },
92
109
  {
93
110
  "description": "multiple subtraction",
94
111
  "property": "answer",
95
- "input": "What is 20 minus 4 minus 13?",
112
+ "input": {
113
+ "question": "What is 20 minus 4 minus 13?"
114
+ },
96
115
  "expected": 3
97
116
  },
98
117
  {
99
118
  "description": "subtraction then addition",
100
119
  "property": "answer",
101
- "input": "What is 17 minus 6 plus 3?",
120
+ "input": {
121
+ "question": "What is 17 minus 6 plus 3?"
122
+ },
102
123
  "expected": 14
103
124
  },
104
125
  {
105
126
  "description": "multiple multiplication",
106
127
  "property": "answer",
107
- "input": "What is 2 multiplied by -2 multiplied by 3?",
128
+ "input": {
129
+ "question": "What is 2 multiplied by -2 multiplied by 3?"
130
+ },
108
131
  "expected": -12
109
132
  },
110
133
  {
111
134
  "description": "addition and multiplication",
112
135
  "property": "answer",
113
- "input": "What is -3 plus 7 multiplied by -2?",
136
+ "input": {
137
+ "question": "What is -3 plus 7 multiplied by -2?"
138
+ },
114
139
  "expected": -8
115
140
  },
116
141
  {
117
142
  "description": "multiple division",
118
143
  "property": "answer",
119
- "input": "What is -12 divided by 2 divided by -3?",
144
+ "input": {
145
+ "question": "What is -12 divided by 2 divided by -3?"
146
+ },
120
147
  "expected": 2
121
148
  },
122
149
  {
123
150
  "description": "unknown operation",
124
151
  "property": "answer",
125
- "input": "What is 52 cubed?",
152
+ "input": {
153
+ "question": "What is 52 cubed?"
154
+ },
126
155
  "expected": false
127
156
  },
128
157
  {
129
158
  "description": "Non math question",
130
159
  "property": "answer",
131
- "input": "Who is the President of the United States?",
160
+ "input": {
161
+ "question": "Who is the President of the United States?"
162
+ },
132
163
  "expected": false
133
164
  }
134
165
  ]
135
166
  }
136
-
137
167
  =end code
@@ -10,7 +10,7 @@ submethod TWEAK {
10
10
  if $!exercise && (my $cdata =
11
11
  $base-dir.add: "problem-specifications/exercises/$!exercise/canonical-data.json") ~~ :f
12
12
  {
13
- %!data<cdata><json> = $cdata.slurp;
13
+ %!data<cdata><json> = $cdata.slurp.trim;
14
14
  }
15
15
  }
16
16
 
@@ -6,7 +6,7 @@ use lib (my $base-dir = $?FILE.IO.resolve.parent.parent).add('lib');
6
6
  use Exercism::Generator;
7
7
 
8
8
  bail-out if $base-dir.add('problem-specifications') !~~ :d;
9
- for $base-dir.add('exercises').dir {
9
+ for $base-dir.add('exercises').dir.sort {
10
10
  if .add('.meta/exercise-data.yaml') ~~ :f {
11
11
  todo '';
12
12
  is .add("{.basename}.t").slurp,
@@ -27,6 +27,5 @@ my $c-data = from-json $=pod.pop.contents;#`{{/cdata}}
27
27
 
28
28
  =head2 Canonical Data
29
29
  =begin code
30
-
31
30
  #`{{&json}}
32
31
  =end code#`{{/cdata}}