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
@@ -3,7 +3,7 @@ version: 3
3
3
  plan: 10
4
4
  tests: |-
5
5
  for $c-data<cases>».<cases>».Array.flat {
6
- given is-pangram .<input> -> $result {
6
+ given is-pangram .<input><sentence> -> $result {
7
7
  subtest .<description>, {
8
8
  plan 2;
9
9
  isa-ok $result, Bool;
@@ -16,7 +16,7 @@ if Pangram.^ver !~~ $version {
16
16
 
17
17
  my $c-data = from-json $=pod.pop.contents;
18
18
  for $c-data<cases>».<cases>».Array.flat {
19
- given is-pangram .<input> -> $result {
19
+ given is-pangram .<input><sentence> -> $result {
20
20
  subtest .<description>, {
21
21
  plan 2;
22
22
  isa-ok $result, Bool;
@@ -27,13 +27,12 @@ for $c-data<cases>».<cases>».Array.flat {
27
27
 
28
28
  =head2 Canonical Data
29
29
  =begin code
30
-
31
30
  {
32
31
  "exercise": "pangram",
33
32
  "comments": [
34
33
  "A pangram is a sentence using every letter of the alphabet at least once."
35
34
  ],
36
- "version": "1.3.0",
35
+ "version": "1.4.0",
37
36
  "cases": [
38
37
  {
39
38
  "description": "Check if the given string is an pangram",
@@ -44,66 +43,85 @@ for $c-data<cases>».<cases>».Array.flat {
44
43
  {
45
44
  "description": "sentence empty",
46
45
  "property": "isPangram",
47
- "input": "",
46
+ "input": {
47
+ "sentence": ""
48
+ },
48
49
  "expected": false
49
50
  },
50
51
  {
51
52
  "description": "recognizes a perfect lower case pangram",
52
53
  "property": "isPangram",
53
- "input": "abcdefghijklmnopqrstuvwxyz",
54
+ "input": {
55
+ "sentence": "abcdefghijklmnopqrstuvwxyz"
56
+ },
54
57
  "expected": true
55
58
  },
56
59
  {
57
60
  "description": "pangram with only lower case",
58
61
  "property": "isPangram",
59
- "input": "the quick brown fox jumps over the lazy dog",
62
+ "input": {
63
+ "sentence": "the quick brown fox jumps over the lazy dog"
64
+ },
60
65
  "expected": true
61
66
  },
62
67
  {
63
68
  "description": "missing character 'x'",
64
69
  "property": "isPangram",
65
- "input": "a quick movement of the enemy will jeopardize five gunboats",
70
+ "input": {
71
+ "sentence": "a quick movement of the enemy will jeopardize five gunboats"
72
+ },
66
73
  "expected": false
67
74
  },
68
75
  {
69
76
  "description": "another missing character, e.g. 'h'",
70
77
  "property": "isPangram",
71
- "input": "five boxing wizards jump quickly at it",
78
+ "input": {
79
+ "sentence": "five boxing wizards jump quickly at it"
80
+ },
72
81
  "expected": false
73
82
  },
74
83
  {
75
84
  "description": "pangram with underscores",
76
85
  "property": "isPangram",
77
- "input": "the_quick_brown_fox_jumps_over_the_lazy_dog",
86
+ "input": {
87
+ "sentence": "the_quick_brown_fox_jumps_over_the_lazy_dog"
88
+ },
78
89
  "expected": true
79
90
  },
80
91
  {
81
92
  "description": "pangram with numbers",
82
93
  "property": "isPangram",
83
- "input": "the 1 quick brown fox jumps over the 2 lazy dogs",
94
+ "input": {
95
+ "sentence": "the 1 quick brown fox jumps over the 2 lazy dogs"
96
+ },
84
97
  "expected": true
85
98
  },
86
99
  {
87
100
  "description": "missing letters replaced by numbers",
88
101
  "property": "isPangram",
89
- "input": "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog",
102
+ "input": {
103
+ "sentence": "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog"
104
+ },
90
105
  "expected": false
91
106
  },
92
107
  {
93
108
  "description": "pangram with mixed case and punctuation",
94
109
  "property": "isPangram",
95
- "input": "\"Five quacking Zephyrs jolt my wax bed.\"",
110
+ "input": {
111
+ "sentence": "\"Five quacking Zephyrs jolt my wax bed.\""
112
+ },
96
113
  "expected": true
97
114
  },
98
115
  {
99
116
  "description": "upper and lower case versions of the same character should not be counted separately",
100
117
  "property": "isPangram",
101
- "input": "the quick brown fox jumps over with lazy FX",
118
+ "input": {
119
+ "sentence": "the quick brown fox jumps over with lazy FX"
120
+ },
102
121
  "expected": false
103
122
  }
104
123
  ]
105
124
  }
106
125
  ]
107
126
  }
108
-
109
127
  =end code
@@ -1,12 +1,12 @@
1
1
  exercise: Phone
2
- version: 4
3
- plan: 12
2
+ version: 5
3
+ plan: 14
4
4
  tests: |-
5
5
  for @($c-data<cases>[0]<cases>) {
6
6
  if .<expected> {
7
- is clean-number(.<phrase>), |.<expected description>;
7
+ is clean-number(.<input><phrase>), |.<expected description>;
8
8
  } else {
9
- nok clean-number(.<phrase>), .<description>;
9
+ nok clean-number(.<input><phrase>), .<description>;
10
10
  }
11
11
  }
12
12
 
@@ -1,4 +1,4 @@
1
- unit module Phone:ver<4>;
1
+ unit module Phone:ver<5>;
2
2
 
3
3
  sub clean-number ($number is copy) is export {
4
4
  $number ~~ s:g/<:!Nd>//;
@@ -1,4 +1,4 @@
1
- unit module Phone:ver<4>;
1
+ unit module Phone:ver<5>;
2
2
 
3
3
  sub clean-number ($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 Phone;
7
- plan 12;
7
+ plan 14;
8
8
 
9
- my Version:D $version = v4;
9
+ my Version:D $version = v5;
10
10
 
11
11
  if Phone.^ver !~~ $version {
12
12
  warn "\nExercise version mismatch. Further tests may fail!"
@@ -17,18 +17,17 @@ if Phone.^ver !~~ $version {
17
17
  my $c-data = from-json $=pod.pop.contents;
18
18
  for @($c-data<cases>[0]<cases>) {
19
19
  if .<expected> {
20
- is clean-number(.<phrase>), |.<expected description>;
20
+ is clean-number(.<input><phrase>), |.<expected description>;
21
21
  } else {
22
- nok clean-number(.<phrase>), .<description>;
22
+ nok clean-number(.<input><phrase>), .<description>;
23
23
  }
24
24
  }
25
25
 
26
26
  =head2 Canonical Data
27
27
  =begin code
28
-
29
28
  {
30
29
  "exercise": "phone-number",
31
- "version": "1.2.0",
30
+ "version": "1.4.0",
32
31
  "cases": [
33
32
  {
34
33
  "description": "Cleanup user-entered phone numbers",
@@ -41,78 +40,117 @@ for @($c-data<cases>[0]<cases>) {
41
40
  {
42
41
  "description": "cleans the number",
43
42
  "property": "clean",
44
- "phrase": "(223) 456-7890",
43
+ "input": {
44
+ "phrase": "(223) 456-7890"
45
+ },
45
46
  "expected": "2234567890"
46
47
  },
47
48
  {
48
49
  "description": "cleans numbers with dots",
49
50
  "property": "clean",
50
- "phrase": "223.456.7890",
51
+ "input": {
52
+ "phrase": "223.456.7890"
53
+ },
51
54
  "expected": "2234567890"
52
55
  },
53
56
  {
54
57
  "description": "cleans numbers with multiple spaces",
55
58
  "property": "clean",
56
- "phrase": "223 456 7890 ",
59
+ "input": {
60
+ "phrase": "223 456 7890 "
61
+ },
57
62
  "expected": "2234567890"
58
63
  },
59
64
  {
60
65
  "description": "invalid when 9 digits",
61
66
  "property": "clean",
62
- "phrase": "123456789",
67
+ "input": {
68
+ "phrase": "123456789"
69
+ },
63
70
  "expected": null
64
71
  },
65
72
  {
66
73
  "description": "invalid when 11 digits does not start with a 1",
67
74
  "property": "clean",
68
- "phrase": "22234567890",
75
+ "input": {
76
+ "phrase": "22234567890"
77
+ },
69
78
  "expected": null
70
79
  },
71
80
  {
72
81
  "description": "valid when 11 digits and starting with 1",
73
82
  "property": "clean",
74
- "phrase": "12234567890",
83
+ "input": {
84
+ "phrase": "12234567890"
85
+ },
75
86
  "expected": "2234567890"
76
87
  },
77
88
  {
78
89
  "description": "valid when 11 digits and starting with 1 even with punctuation",
79
90
  "property": "clean",
80
- "phrase": "+1 (223) 456-7890",
91
+ "input": {
92
+ "phrase": "+1 (223) 456-7890"
93
+ },
81
94
  "expected": "2234567890"
82
95
  },
83
96
  {
84
97
  "description": "invalid when more than 11 digits",
85
98
  "property": "clean",
86
- "phrase": "321234567890",
99
+ "input": {
100
+ "phrase": "321234567890"
101
+ },
87
102
  "expected": null
88
103
  },
89
104
  {
90
105
  "description": "invalid with letters",
91
106
  "property": "clean",
92
- "phrase": "123-abc-7890",
107
+ "input": {
108
+ "phrase": "123-abc-7890"
109
+ },
93
110
  "expected": null
94
111
  },
95
112
  {
96
113
  "description": "invalid with punctuations",
97
114
  "property": "clean",
98
- "phrase": "123-@:!-7890",
115
+ "input": {
116
+ "phrase": "123-@:!-7890"
117
+ },
118
+ "expected": null
119
+ },
120
+ {
121
+ "description": "invalid if area code starts with 0",
122
+ "property": "clean",
123
+ "input": {
124
+ "phrase": "(023) 456-7890"
125
+ },
99
126
  "expected": null
100
127
  },
101
128
  {
102
- "description": "invalid if area code does not start with 2-9",
129
+ "description": "invalid if area code starts with 1",
103
130
  "property": "clean",
104
- "phrase": "(123) 456-7890",
131
+ "input": {
132
+ "phrase": "(123) 456-7890"
133
+ },
105
134
  "expected": null
106
135
  },
107
136
  {
108
- "description": "invalid if exchange code does not start with 2-9",
137
+ "description": "invalid if exchange code starts with 0",
109
138
  "property": "clean",
110
- "phrase": "(223) 056-7890",
139
+ "input": {
140
+ "phrase": "(223) 056-7890"
141
+ },
142
+ "expected": null
143
+ },
144
+ {
145
+ "description": "invalid if exchange code starts with 1",
146
+ "property": "clean",
147
+ "input": {
148
+ "phrase": "(223) 156-7890"
149
+ },
111
150
  "expected": null
112
151
  }
113
152
  ]
114
153
  }
115
154
  ]
116
155
  }
117
-
118
156
  =end code
@@ -25,7 +25,6 @@ for @($c-data<cases>) {
25
25
 
26
26
  =head2 Canonical Data
27
27
  =begin code
28
-
29
28
  {
30
29
  "exercise": "raindrops",
31
30
  "version": "1.0.0",
@@ -140,5 +139,4 @@ for @($c-data<cases>) {
140
139
  }
141
140
  ]
142
141
  }
143
-
144
142
  =end code
@@ -2,7 +2,7 @@ exercise: RNA
2
2
  version: 3
3
3
  plan: 5
4
4
  tests: |-
5
- is .<dna>.&to-rna, |.<expected description> for $c-data<cases>.values;
5
+ is .<input><dna>.&to-rna, |.<expected description> for $c-data<cases>.values;
6
6
 
7
7
  unit: module
8
8
  example: |-
@@ -38,7 +38,7 @@ tests, including any optional tests marked as 'TODO'.
38
38
 
39
39
  ## Source
40
40
 
41
- Rosalind [http://rosalind.info/problems/rna](http://rosalind.info/problems/rna)
41
+ Hyperphysics [http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html](http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html)
42
42
 
43
43
  ## Submitting Incomplete Solutions
44
44
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -15,46 +15,54 @@ if RNA.^ver !~~ $version {
15
15
  }
16
16
 
17
17
  my $c-data = from-json $=pod.pop.contents;
18
- is .<dna>.&to-rna, |.<expected description> for $c-data<cases>.values;
18
+ is .<input><dna>.&to-rna, |.<expected description> for $c-data<cases>.values;
19
19
 
20
20
  =head2 Canonical Data
21
21
  =begin code
22
-
23
22
  {
24
23
  "exercise": "rna-transcription",
25
- "version": "1.1.0",
24
+ "version": "1.2.0",
26
25
  "cases": [
27
26
  {
28
27
  "description": "RNA complement of cytosine is guanine",
29
28
  "property": "toRna",
30
- "dna": "C",
29
+ "input": {
30
+ "dna": "C"
31
+ },
31
32
  "expected": "G"
32
33
  },
33
34
  {
34
35
  "description": "RNA complement of guanine is cytosine",
35
36
  "property": "toRna",
36
- "dna": "G",
37
+ "input": {
38
+ "dna": "G"
39
+ },
37
40
  "expected": "C"
38
41
  },
39
42
  {
40
43
  "description": "RNA complement of thymine is adenine",
41
44
  "property": "toRna",
42
- "dna": "T",
45
+ "input": {
46
+ "dna": "T"
47
+ },
43
48
  "expected": "A"
44
49
  },
45
50
  {
46
51
  "description": "RNA complement of adenine is uracil",
47
52
  "property": "toRna",
48
- "dna": "A",
53
+ "input": {
54
+ "dna": "A"
55
+ },
49
56
  "expected": "U"
50
57
  },
51
58
  {
52
59
  "description": "RNA complement",
53
60
  "property": "toRna",
54
- "dna": "ACGTGGTCTTAA",
61
+ "input": {
62
+ "dna": "ACGTGGTCTTAA"
63
+ },
55
64
  "expected": "UGCACCAGAAUU"
56
65
  }
57
66
  ]
58
67
  }
59
-
60
68
  =end code
@@ -1,9 +1,9 @@
1
1
  exercise: RomanNumerals
2
- version: 2
3
- plan: 18
2
+ version: 3
3
+ plan: 19
4
4
  tests: |-
5
5
  for $c-data<cases>.values {
6
- is to-roman(.<number>), |.<expected description>;
6
+ is to-roman(.<input><number>), |.<expected description>;
7
7
  }
8
8
 
9
9
  unit: module
@@ -1,4 +1,4 @@
1
- unit module RomanNumerals:ver<2>;
1
+ unit module RomanNumerals:ver<3>;
2
2
 
3
3
 
4
4
  my %table{Int} = <1000 900 500 400 100 90 50 40 10 9 5 4 1>