trackler 2.1.0.9 → 2.1.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. checksums.yaml +4 -4
  2. data/common/exercises/perfect-numbers/description.md +2 -2
  3. data/common/exercises/phone-number/canonical-data.json +1 -7
  4. data/common/exercises/tournament/canonical-data.json +96 -21
  5. data/common/exercises/tournament/description.md +0 -5
  6. data/lib/trackler/version.rb +1 -1
  7. data/tracks/coq/README.md +6 -8
  8. data/tracks/coq/exercises/hello-world/example.v +3 -0
  9. data/tracks/coq/exercises/hello-world/hello-world.v +3 -0
  10. data/tracks/coq/exercises/rna-transcription/DNA.v +4 -0
  11. data/tracks/coq/exercises/rna-transcription/example.v +15 -0
  12. data/tracks/coq/exercises/rna-transcription/rna-transcription.v +5 -0
  13. data/tracks/coq/exercises/tautology/description.md +1 -0
  14. data/tracks/coq/exercises/tautology/example.v +4 -0
  15. data/tracks/coq/exercises/tautology/tautology.v +4 -0
  16. data/tracks/haskell/exercises/accumulate/package.yaml +1 -0
  17. data/tracks/haskell/exercises/accumulate/test/Tests.hs +0 -3
  18. data/tracks/haskell/exercises/acronym/package.yaml +1 -0
  19. data/tracks/haskell/exercises/acronym/test/Tests.hs +0 -5
  20. data/tracks/haskell/exercises/all-your-base/package.yaml +1 -0
  21. data/tracks/haskell/exercises/all-your-base/test/Tests.hs +0 -2
  22. data/tracks/haskell/exercises/allergies/package.yaml +1 -0
  23. data/tracks/haskell/exercises/allergies/test/Tests.hs +0 -2
  24. data/tracks/haskell/exercises/alphametics/package.yaml +1 -0
  25. data/tracks/haskell/exercises/alphametics/test/Tests.hs +0 -2
  26. data/tracks/haskell/exercises/anagram/package.yaml +1 -0
  27. data/tracks/haskell/exercises/anagram/test/Tests.hs +0 -2
  28. data/tracks/haskell/exercises/atbash-cipher/package.yaml +1 -0
  29. data/tracks/haskell/exercises/atbash-cipher/test/Tests.hs +0 -2
  30. data/tracks/haskell/exercises/bank-account/package.yaml +1 -0
  31. data/tracks/haskell/exercises/bank-account/test/Tests.hs +0 -3
  32. data/tracks/haskell/exercises/beer-song/package.yaml +1 -0
  33. data/tracks/haskell/exercises/binary/package.yaml +1 -0
  34. data/tracks/haskell/exercises/binary/test/Tests.hs +0 -1
  35. data/tracks/haskell/exercises/binary-search-tree/package.yaml +1 -0
  36. data/tracks/haskell/exercises/binary-search-tree/test/Tests.hs +0 -3
  37. data/tracks/haskell/exercises/bob/package.yaml +1 -0
  38. data/tracks/haskell/exercises/bob/test/Tests.hs +0 -2
  39. data/tracks/haskell/exercises/bowling/package.yaml +1 -0
  40. data/tracks/haskell/exercises/bowling/test/Tests.hs +0 -2
  41. data/tracks/haskell/exercises/bracket-push/package.yaml +1 -0
  42. data/tracks/haskell/exercises/bracket-push/test/Tests.hs +1 -6
  43. data/tracks/haskell/exercises/change/package.yaml +1 -0
  44. data/tracks/haskell/exercises/change/test/Tests.hs +0 -2
  45. data/tracks/haskell/exercises/clock/package.yaml +1 -0
  46. data/tracks/haskell/exercises/clock/test/Tests.hs +0 -2
  47. data/tracks/haskell/exercises/connect/package.yaml +1 -0
  48. data/tracks/haskell/exercises/connect/test/Tests.hs +0 -2
  49. data/tracks/haskell/exercises/crypto-square/package.yaml +1 -0
  50. data/tracks/haskell/exercises/crypto-square/test/Tests.hs +0 -2
  51. data/tracks/haskell/exercises/custom-set/package.yaml +1 -0
  52. data/tracks/haskell/exercises/custom-set/test/Tests.hs +0 -3
  53. data/tracks/haskell/exercises/difference-of-squares/package.yaml +1 -0
  54. data/tracks/haskell/exercises/difference-of-squares/test/Tests.hs +0 -3
  55. data/tracks/haskell/exercises/dominoes/package.yaml +1 -0
  56. data/tracks/haskell/exercises/dominoes/test/Tests.hs +0 -2
  57. data/tracks/haskell/exercises/etl/package.yaml +1 -0
  58. data/tracks/haskell/exercises/etl/test/Tests.hs +0 -2
  59. data/tracks/haskell/exercises/food-chain/package.yaml +1 -0
  60. data/tracks/haskell/exercises/forth/package.yaml +1 -0
  61. data/tracks/haskell/exercises/forth/test/Tests.hs +0 -2
  62. data/tracks/haskell/exercises/gigasecond/package.yaml +1 -0
  63. data/tracks/haskell/exercises/gigasecond/test/Tests.hs +0 -3
  64. data/tracks/haskell/exercises/go-counting/package.yaml +1 -0
  65. data/tracks/haskell/exercises/go-counting/test/Tests.hs +0 -3
  66. data/tracks/haskell/exercises/grade-school/package.yaml +1 -0
  67. data/tracks/haskell/exercises/grade-school/test/Tests.hs +0 -3
  68. data/tracks/haskell/exercises/grains/package.yaml +1 -0
  69. data/tracks/haskell/exercises/grains/test/Tests.hs +0 -2
  70. data/tracks/haskell/exercises/hamming/package.yaml +1 -0
  71. data/tracks/haskell/exercises/hamming/test/Tests.hs +0 -2
  72. data/tracks/haskell/exercises/hello-world/package.yaml +1 -0
  73. data/tracks/haskell/exercises/hexadecimal/package.yaml +1 -0
  74. data/tracks/haskell/exercises/hexadecimal/test/Tests.hs +0 -3
  75. data/tracks/haskell/exercises/house/package.yaml +1 -0
  76. data/tracks/haskell/exercises/kindergarten-garden/package.yaml +1 -0
  77. data/tracks/haskell/exercises/kindergarten-garden/test/Tests.hs +0 -3
  78. data/tracks/haskell/exercises/largest-series-product/package.yaml +1 -0
  79. data/tracks/haskell/exercises/largest-series-product/test/Tests.hs +0 -3
  80. data/tracks/haskell/exercises/leap/package.yaml +1 -0
  81. data/tracks/haskell/exercises/leap/test/Tests.hs +0 -2
  82. data/tracks/haskell/exercises/lens-person/package.yaml +1 -0
  83. data/tracks/haskell/exercises/lens-person/test/Tests.hs +0 -3
  84. data/tracks/haskell/exercises/linked-list/package.yaml +1 -0
  85. data/tracks/haskell/exercises/linked-list/test/Tests.hs +0 -3
  86. data/tracks/haskell/exercises/list-ops/package.yaml +1 -0
  87. data/tracks/haskell/exercises/list-ops/test/Tests.hs +0 -3
  88. data/tracks/haskell/exercises/luhn/package.yaml +1 -0
  89. data/tracks/haskell/exercises/luhn/test/Tests.hs +0 -3
  90. data/tracks/haskell/exercises/matrix/package.yaml +1 -0
  91. data/tracks/haskell/exercises/matrix/test/Tests.hs +0 -3
  92. data/tracks/haskell/exercises/meetup/package.yaml +1 -0
  93. data/tracks/haskell/exercises/meetup/test/Tests.hs +0 -2
  94. data/tracks/haskell/exercises/minesweeper/package.yaml +1 -0
  95. data/tracks/haskell/exercises/minesweeper/test/Tests.hs +0 -3
  96. data/tracks/haskell/exercises/nth-prime/package.yaml +1 -0
  97. data/tracks/haskell/exercises/nth-prime/test/Tests.hs +0 -2
  98. data/tracks/haskell/exercises/nucleotide-count/package.yaml +1 -0
  99. data/tracks/haskell/exercises/nucleotide-count/test/Tests.hs +0 -2
  100. data/tracks/haskell/exercises/ocr-numbers/package.yaml +1 -0
  101. data/tracks/haskell/exercises/ocr-numbers/test/Tests.hs +0 -3
  102. data/tracks/haskell/exercises/octal/package.yaml +1 -0
  103. data/tracks/haskell/exercises/octal/test/Tests.hs +0 -3
  104. data/tracks/haskell/exercises/palindrome-products/package.yaml +1 -0
  105. data/tracks/haskell/exercises/palindrome-products/test/Tests.hs +0 -3
  106. data/tracks/haskell/exercises/pangram/package.yaml +1 -0
  107. data/tracks/haskell/exercises/pangram/test/Tests.hs +0 -5
  108. data/tracks/haskell/exercises/parallel-letter-frequency/package.yaml +1 -0
  109. data/tracks/haskell/exercises/parallel-letter-frequency/test/Tests.hs +0 -3
  110. data/tracks/haskell/exercises/pascals-triangle/package.yaml +1 -0
  111. data/tracks/haskell/exercises/pascals-triangle/test/Tests.hs +0 -2
  112. data/tracks/haskell/exercises/phone-number/package.yaml +1 -0
  113. data/tracks/haskell/exercises/phone-number/test/Tests.hs +0 -2
  114. data/tracks/haskell/exercises/pig-latin/package.yaml +1 -0
  115. data/tracks/haskell/exercises/pig-latin/test/Tests.hs +0 -2
  116. data/tracks/haskell/exercises/pov/package.yaml +1 -0
  117. data/tracks/haskell/exercises/pov/test/Tests.hs +0 -2
  118. data/tracks/haskell/exercises/prime-factors/package.yaml +1 -0
  119. data/tracks/haskell/exercises/prime-factors/test/Tests.hs +0 -2
  120. data/tracks/haskell/exercises/pythagorean-triplet/package.yaml +1 -0
  121. data/tracks/haskell/exercises/pythagorean-triplet/test/Tests.hs +0 -3
  122. data/tracks/haskell/exercises/queen-attack/package.yaml +1 -0
  123. data/tracks/haskell/exercises/queen-attack/test/Tests.hs +0 -2
  124. data/tracks/haskell/exercises/raindrops/package.yaml +1 -0
  125. data/tracks/haskell/exercises/raindrops/test/Tests.hs +0 -2
  126. data/tracks/haskell/exercises/rna-transcription/package.yaml +1 -0
  127. data/tracks/haskell/exercises/rna-transcription/test/Tests.hs +0 -2
  128. data/tracks/haskell/exercises/robot-name/package.yaml +1 -0
  129. data/tracks/haskell/exercises/robot-name/test/Tests.hs +0 -3
  130. data/tracks/haskell/exercises/robot-simulator/package.yaml +1 -0
  131. data/tracks/haskell/exercises/robot-simulator/test/Tests.hs +0 -3
  132. data/tracks/haskell/exercises/roman-numerals/package.yaml +1 -0
  133. data/tracks/haskell/exercises/roman-numerals/test/Tests.hs +0 -2
  134. data/tracks/haskell/exercises/run-length-encoding/package.yaml +1 -0
  135. data/tracks/haskell/exercises/run-length-encoding/test/Tests.hs +0 -4
  136. data/tracks/haskell/exercises/saddle-points/package.yaml +1 -0
  137. data/tracks/haskell/exercises/saddle-points/test/Tests.hs +0 -3
  138. data/tracks/haskell/exercises/say/package.yaml +1 -0
  139. data/tracks/haskell/exercises/say/test/Tests.hs +0 -2
  140. data/tracks/haskell/exercises/scrabble-score/package.yaml +1 -0
  141. data/tracks/haskell/exercises/scrabble-score/test/Tests.hs +0 -2
  142. data/tracks/haskell/exercises/secret-handshake/package.yaml +1 -0
  143. data/tracks/haskell/exercises/secret-handshake/test/Tests.hs +0 -2
  144. data/tracks/haskell/exercises/series/package.yaml +1 -0
  145. data/tracks/haskell/exercises/series/test/Tests.hs +0 -3
  146. data/tracks/haskell/exercises/sgf-parsing/package.yaml +1 -0
  147. data/tracks/haskell/exercises/sgf-parsing/test/Tests.hs +0 -3
  148. data/tracks/haskell/exercises/sieve/package.yaml +1 -0
  149. data/tracks/haskell/exercises/sieve/test/Tests.hs +0 -2
  150. data/tracks/haskell/exercises/simple-cipher/package.yaml +1 -0
  151. data/tracks/haskell/exercises/simple-cipher/test/Tests.hs +0 -3
  152. data/tracks/haskell/exercises/simple-linked-list/package.yaml +1 -0
  153. data/tracks/haskell/exercises/simple-linked-list/test/Tests.hs +0 -3
  154. data/tracks/haskell/exercises/space-age/package.yaml +1 -0
  155. data/tracks/haskell/exercises/space-age/test/Tests.hs +0 -2
  156. data/tracks/haskell/exercises/strain/package.yaml +1 -0
  157. data/tracks/haskell/exercises/strain/test/Tests.hs +0 -3
  158. data/tracks/haskell/exercises/sublist/package.yaml +1 -0
  159. data/tracks/haskell/exercises/sublist/test/Tests.hs +0 -2
  160. data/tracks/haskell/exercises/sum-of-multiples/package.yaml +1 -0
  161. data/tracks/haskell/exercises/sum-of-multiples/test/Tests.hs +0 -2
  162. data/tracks/haskell/exercises/triangle/package.yaml +1 -0
  163. data/tracks/haskell/exercises/triangle/test/Tests.hs +0 -3
  164. data/tracks/haskell/exercises/trinary/package.yaml +1 -0
  165. data/tracks/haskell/exercises/trinary/test/Tests.hs +0 -3
  166. data/tracks/haskell/exercises/word-count/package.yaml +1 -0
  167. data/tracks/haskell/exercises/word-count/test/Tests.hs +0 -2
  168. data/tracks/haskell/exercises/wordy/package.yaml +1 -0
  169. data/tracks/haskell/exercises/wordy/test/Tests.hs +0 -2
  170. data/tracks/haskell/exercises/zebra-puzzle/package.yaml +1 -0
  171. data/tracks/haskell/exercises/zipper/package.yaml +1 -0
  172. data/tracks/haskell/exercises/zipper/test/Tests.hs +0 -3
  173. data/tracks/java/exercises/book-store/src/test/java/BookstoreTest.java +12 -12
  174. data/tracks/java/exercises/ocr-numbers/src/test/java/OpticalCharacterReaderTest.java +16 -16
  175. data/tracks/java/exercises/strain/src/test/java/StrainTest.java +11 -11
  176. data/tracks/perl6/README.md +12 -0
  177. data/tracks/perl6/bin/README.md +3 -0
  178. data/tracks/perl6/config.json +20 -20
  179. data/tracks/perl6/exercises/accumulate/{Example.pm → Example.pm6} +0 -0
  180. data/tracks/perl6/exercises/all-your-base/{Example.pm → Example.pm6} +0 -0
  181. data/tracks/perl6/exercises/allergies/{Example.pm → Example.pm6} +0 -0
  182. data/tracks/perl6/exercises/anagram/{Example.pm → Example.pm6} +0 -0
  183. data/tracks/perl6/exercises/atbash-cipher/{Example.pm → Example.pm6} +0 -0
  184. data/tracks/perl6/exercises/binary/{Example.pm → Example.pm6} +0 -0
  185. data/tracks/perl6/exercises/bob/{Example.pm → Example.pm6} +0 -0
  186. data/tracks/perl6/exercises/bob/bob.t +181 -180
  187. data/tracks/perl6/exercises/bob/example.yaml +1 -0
  188. data/tracks/perl6/exercises/grade-school/{Example.pm → Example.pm6} +0 -0
  189. data/tracks/perl6/exercises/grade-school/grade-school.t +9 -18
  190. data/tracks/perl6/exercises/grains/{Example.pm → Example.pm6} +0 -0
  191. data/tracks/perl6/exercises/hello-world/{Example.pm → Example.pm6} +0 -0
  192. data/tracks/perl6/exercises/hello-world/example.yaml +1 -0
  193. data/tracks/perl6/exercises/hello-world/hello-world.t +38 -43
  194. data/tracks/perl6/exercises/leap/{Example.pm → Example.pm6} +0 -0
  195. data/tracks/perl6/exercises/leap/leap.t +40 -42
  196. data/tracks/perl6/exercises/phone-number/{Example.pm → Example.pm6} +2 -2
  197. data/tracks/perl6/exercises/phone-number/PhoneNumber.pm6 +1 -1
  198. data/tracks/perl6/exercises/phone-number/example.yaml +2 -2
  199. data/tracks/perl6/exercises/phone-number/phone-number.t +3 -9
  200. data/tracks/perl6/exercises/raindrops/{Example.pm → Example.pm6} +0 -0
  201. data/tracks/perl6/exercises/rna-transcription/{Example.pm → Example.pm6} +0 -0
  202. data/tracks/perl6/exercises/robot-name/{Example.pm → Example.pm6} +0 -0
  203. data/tracks/perl6/exercises/scrabble-score/{Example.pm → Example.pm6} +0 -0
  204. data/tracks/perl6/exercises/space-age/{Example.pm → Example.pm6} +0 -0
  205. data/tracks/perl6/exercises/trinary/{Example.pm → Example.pm6} +0 -0
  206. data/tracks/perl6/exercises/word-count/{Example.pm → Example.pm6} +0 -0
  207. data/tracks/perl6/exercises/wordy/{Example.pm → Example.pm6} +0 -0
  208. data/tracks/python/.github/stale.yml +4 -4
  209. data/tracks/python/config.json +24 -0
  210. data/tracks/python/exercises/alphametics/alphametics.py +2 -0
  211. data/tracks/python/exercises/alphametics/alphametics_test.py +71 -0
  212. data/tracks/python/exercises/alphametics/example.py +29 -0
  213. data/tracks/python/exercises/book-store/book_store.py +2 -0
  214. data/tracks/python/exercises/book-store/book_store_test.py +72 -0
  215. data/tracks/python/exercises/book-store/example.py +29 -0
  216. data/tracks/python/exercises/meetup/meetup_test.py +341 -1
  217. data/tracks/python/exercises/tournament/example.py +45 -0
  218. data/tracks/python/exercises/tournament/tournament.py +2 -0
  219. data/tracks/python/exercises/tournament/tournament_test.py +70 -0
  220. data/tracks/python/exercises/variable-length-quantity/example.py +34 -0
  221. data/tracks/python/exercises/variable-length-quantity/variable_length_quantity.py +6 -0
  222. data/tracks/python/exercises/variable-length-quantity/variable_length_quantity_test.py +100 -0
  223. data/tracks/r/config.json +23 -23
  224. data/tracks/r/exercises/perfect-numbers/test_perfect-numbers.R +1 -1
  225. data/tracks/r/exercises/prime-factors/test_prime-factors.R +2 -0
  226. data/tracks/r/exercises/tournament/example.R +2 -5
  227. data/tracks/scala/exercises/leap/example.scala +4 -4
  228. data/tracks/scala/exercises/leap/src/main/scala/Leap.scala +3 -0
  229. data/tracks/scala/exercises/leap/src/test/scala/LeapTest.scala +6 -6
  230. metadata +43 -22
@@ -16,7 +16,7 @@ public class StrainTest {
16
16
  Assert.assertEquals(expectedOutput, Strain.keep(input, x -> x < 10));
17
17
  }
18
18
 
19
- @Ignore
19
+ @Ignore("Remove to run test")
20
20
  @Test
21
21
  public void keepEverything() {
22
22
  List<Integer> input = Arrays.asList(1, 2, 3);
@@ -24,7 +24,7 @@ public class StrainTest {
24
24
  Assert.assertEquals(expectedOutput, Strain.keep(input, x -> x < 10));
25
25
  }
26
26
 
27
- @Ignore
27
+ @Ignore("Remove to run test")
28
28
  @Test
29
29
  public void keepFirstAndLast() {
30
30
  List<Integer> input = Arrays.asList(1, 2, 3);
@@ -32,7 +32,7 @@ public class StrainTest {
32
32
  Assert.assertEquals(expectedOutput, Strain.keep(input, x -> x % 2 != 0));
33
33
  }
34
34
 
35
- @Ignore
35
+ @Ignore("Remove to run test")
36
36
  @Test
37
37
  public void keepNeitherFirstNorLast() {
38
38
  List<Integer> input = Arrays.asList(1, 2, 3, 4, 5);
@@ -40,7 +40,7 @@ public class StrainTest {
40
40
  Assert.assertEquals(expectedOutput, Strain.keep(input, x -> x % 2 == 0));
41
41
  }
42
42
 
43
- @Ignore
43
+ @Ignore("Remove to run test")
44
44
  @Test
45
45
  public void KeepStrings() {
46
46
  List<String> words = Arrays
@@ -50,7 +50,7 @@ public class StrainTest {
50
50
  Strain.keep(words, x -> x.startsWith("z")));
51
51
  }
52
52
 
53
- @Ignore
53
+ @Ignore("Remove to run test")
54
54
  @Test
55
55
  public void KeepArrays() {
56
56
  List<List<Integer>> actual = Arrays.asList(
@@ -70,7 +70,7 @@ public class StrainTest {
70
70
  Strain.keep(actual, col -> col.contains(5)));
71
71
  }
72
72
 
73
- @Ignore
73
+ @Ignore("Remove to run test")
74
74
  @Test
75
75
  public void emptyDiscard() {
76
76
  List<Integer> input = new LinkedList<>();
@@ -78,7 +78,7 @@ public class StrainTest {
78
78
  Assert.assertEquals(expectedOutput, Strain.discard(input, x -> x < 10));
79
79
  }
80
80
 
81
- @Ignore
81
+ @Ignore("Remove to run test")
82
82
  @Test
83
83
  public void discardNothing() {
84
84
  List<Integer> input = Arrays.asList(1, 2, 3);
@@ -86,7 +86,7 @@ public class StrainTest {
86
86
  Assert.assertEquals(expectedOutput, Strain.discard(input, x -> x > 10));
87
87
  }
88
88
 
89
- @Ignore
89
+ @Ignore("Remove to run test")
90
90
  @Test
91
91
  public void discardFirstAndLast() {
92
92
  List<Integer> input = Arrays.asList(1, 2, 3);
@@ -95,7 +95,7 @@ public class StrainTest {
95
95
 
96
96
  }
97
97
 
98
- @Ignore
98
+ @Ignore("Remove to run test")
99
99
  @Test
100
100
  public void discardNeitherFirstNorLast() {
101
101
  List<Integer> input = Arrays.asList(1, 2, 3, 4, 5);
@@ -103,7 +103,7 @@ public class StrainTest {
103
103
  Assert.assertEquals(expectedOutput, Strain.discard(input, x -> x % 2 == 0));
104
104
  }
105
105
 
106
- @Ignore
106
+ @Ignore("Remove to run test")
107
107
  @Test
108
108
  public void discardStrings() {
109
109
  List<String> words = Arrays
@@ -113,7 +113,7 @@ public class StrainTest {
113
113
  Strain.discard(words, x -> x.startsWith("z")));
114
114
  }
115
115
 
116
- @Ignore
116
+ @Ignore("Remove to run test")
117
117
  @Test
118
118
  public void discardArrays() {
119
119
  List<List<Integer>> actual = Arrays.asList(
@@ -4,6 +4,18 @@
4
4
 
5
5
  Exercism exercises in Perl 6
6
6
 
7
+ ## Adding and Updating Exercises
8
+
9
+ Please use `exercise-gen.pl6` in the `bin/` directory when either adding or updating an exercise.
10
+ The `bin/` directory contains a `README.md` with information on how to use the generator.
11
+
12
+ When adding a new exercise, ensure that the exercise is included in the `exercises` array in `config.json`.
13
+
14
+ ## Running The Tests
15
+
16
+ Set `EXERCISM` as an environment variable (e.g. `export EXERCISM=1` in bash), and run either `prove -re perl6`
17
+ to run all tests in all subdirectories, or `prove -e perl6 /path/to/test.t` to run an individual test file.
18
+
7
19
  ## Contributing Guide
8
20
 
9
21
  Please see the [contributing guide](https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data)
@@ -5,6 +5,9 @@ The `exercise-gen.pl6` file can be used in the following ways:
5
5
  * With the argument `--all` to run the generator for all exercises.
6
6
  i.e `./exercise-gen.pl6 --all`
7
7
 
8
+ You will either need to create a symlink to or clone the
9
+ [x-common](https://github.com/exercism/x-common) repository
10
+ into the root directory of this repository.
8
11
  The generator will retrieve data from an `example.yaml` file within
9
12
  each exercise directory, and use the contained information to generate
10
13
  test files using `templates/test.mustache`. If it finds a
@@ -26,27 +26,22 @@
26
26
  },
27
27
  {
28
28
  "difficulty": 1,
29
- "slug": "bob",
29
+ "slug": "leap",
30
30
  "topics": []
31
31
  },
32
- {
33
- "difficulty" : 1,
34
- "slug" : "atbash-cipher",
35
- "topics" : []
36
- },
37
32
  {
38
33
  "difficulty": 1,
39
- "slug": "leap",
34
+ "slug": "bob",
40
35
  "topics": []
41
36
  },
42
37
  {
43
38
  "difficulty": 1,
44
- "slug": "grains",
39
+ "slug": "phone-number",
45
40
  "topics": []
46
41
  },
47
42
  {
48
43
  "difficulty": 1,
49
- "slug": "raindrops",
44
+ "slug": "rna-transcription",
50
45
  "topics": []
51
46
  },
52
47
  {
@@ -56,22 +51,22 @@
56
51
  },
57
52
  {
58
53
  "difficulty": 1,
59
- "slug": "scrabble-score",
54
+ "slug": "wordy",
60
55
  "topics": []
61
56
  },
62
57
  {
63
58
  "difficulty": 1,
64
- "slug": "all-your-base",
59
+ "slug": "raindrops",
65
60
  "topics": []
66
61
  },
67
62
  {
68
63
  "difficulty": 1,
69
- "slug": "word-count",
64
+ "slug": "scrabble-score",
70
65
  "topics": []
71
66
  },
72
67
  {
73
68
  "difficulty": 1,
74
- "slug": "anagram",
69
+ "slug": "word-count",
75
70
  "topics": []
76
71
  },
77
72
  {
@@ -81,39 +76,44 @@
81
76
  },
82
77
  {
83
78
  "difficulty": 1,
84
- "slug": "robot-name",
79
+ "slug": "accumulate",
85
80
  "topics": []
86
81
  },
87
82
  {
88
83
  "difficulty": 1,
89
- "slug": "accumulate",
84
+ "slug": "grains",
90
85
  "topics": []
91
86
  },
92
87
  {
93
88
  "difficulty": 1,
94
- "slug": "phone-number",
89
+ "slug": "all-your-base",
95
90
  "topics": []
96
91
  },
97
92
  {
98
93
  "difficulty": 1,
99
- "slug": "rna-transcription",
94
+ "slug": "anagram",
100
95
  "topics": []
101
96
  },
102
97
  {
103
98
  "difficulty": 1,
104
- "slug": "wordy",
99
+ "slug": "robot-name",
105
100
  "topics": []
106
101
  },
107
102
  {
108
103
  "difficulty" : 1,
109
- "slug" : "allergies",
110
- "topics" : []
104
+ "slug" : "atbash-cipher",
105
+ "topics" : []
111
106
  },
112
107
  {
113
108
  "difficulty": 1,
114
109
  "slug": "space-age",
115
110
  "topics": []
116
111
  },
112
+ {
113
+ "difficulty" : 1,
114
+ "slug" : "allergies",
115
+ "topics" : []
116
+ },
117
117
  {
118
118
  "difficulty": 1,
119
119
  "slug": "linked-list",
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env perl6
2
2
  use v6;
3
3
  use Test;
4
- use lib my $dir = $?FILE.IO.dirname; # Look for the module inside the same directory as this test file.
4
+ use lib my $dir = $?FILE.IO.dirname; #`[Look for the module inside the same directory as this test file.]
5
5
  use JSON::Tiny;
6
6
 
7
- my $exercise = 'Bob'; # The name of this exercise.
8
- my $version = v1; # The version we will be matching against the exercise.
9
- my $module = %*ENV<EXERCISM> ?? 'Example' !! $exercise; # %*ENV<EXERCISM> is for tests not directly for the exercise, don't worry about these :)
10
- plan 28; # This is how many tests we expect to run.
7
+ my $exercise = 'Bob'; #`[The name of this exercise.]
8
+ my $version = v1; #`[The version we will be matching against the exercise.]
9
+ my $module = %*ENV<EXERCISM> ?? 'Example' !! $exercise; #`[%*ENV<EXERCISM> is for tests not directly for the exercise, don't worry about these :)]
10
+ plan 28; #`[This is how many tests we expect to run.]
11
11
 
12
- # Check that the module can be use-d.
12
+ #`[Check that the module can be use-d.]
13
13
  use-ok $module or bail-out;
14
14
  require ::($module);
15
15
 
16
- # If the exercise is updated, we want to make sure other people testing
17
- # your code don't think you've made a mistake if things have changed!
16
+ #`[If the exercise is updated, we want to make sure other people testing
17
+ your code don't think you've made a mistake if things have changed!]
18
18
  if ::($exercise).^ver !~~ $version {
19
19
  warn "\nExercise version mismatch. Further tests may fail!"
20
20
  ~ "\n$exercise is $(::($exercise).^ver.gist). "
@@ -22,184 +22,185 @@ if ::($exercise).^ver !~~ $version {
22
22
  bail-out 'Example version must match test version.' if %*ENV<EXERCISM>;
23
23
  }
24
24
 
25
- # Check that the Class 'Bob' can use all of the methods
26
- # needed in the tests (only 'hey' for this one).
27
- subtest 'Class method(s)', {
28
- plan 1;
25
+ #`[Check that the class 'Bob' can use all of the methods
26
+ needed in the tests (only 'hey' for this one).]
27
+ subtest 'Class methods', {
29
28
  ok ::($exercise).can($_), $_ for <hey>;
30
29
  }
31
30
 
32
- # Go through all of the cases (hiding at the bottom of this file)
33
- # and check that Bob gives us the correct response for each one.
34
- is ::($exercise).?hey(.<input>), |.<expected description> for @(my $c-data.<cases>);
31
+ my $c-data;
32
+ #`[Go through all of the cases (hiding at the bottom of this file)
33
+ and check that Bob gives us the correct response for each one.]
34
+ is ::($exercise).?hey(.<input>), |.<expected description> for @($c-data<cases>);
35
35
 
36
- # Ignore this for your exercise! Tells Exercism folks when exercise cases become out of date.
37
- if %*ENV<EXERCISM> && (my $c-data-file = "$dir/../../x-common/exercises/{$dir.IO.basename}/canonical-data.json".IO.resolve) ~~ :f {
38
- is $c-data, from-json($c-data-file.slurp), 'canonical-data'
39
- } else { skip }
36
+ #`[Ignore this for your exercise! Tells Exercism folks when exercise cases become out of date.]
37
+ if %*ENV<EXERCISM> && (my $c-data-file =
38
+ "$dir/../../x-common/exercises/{$dir.IO.resolve.basename}/canonical-data.json".IO.resolve) ~~ :f
39
+ { is-deeply $c-data, from-json($c-data-file.slurp), 'canonical-data' } else { skip }
40
40
 
41
- # There are no more tests after this :)
42
- done-testing;
41
+ done-testing; #`[There are no more tests after this :)]
43
42
 
44
- # 'INIT' is a phaser, it makes sure that the test data is available before everything else
45
- # starts running (otherwise we'd have to shove all of this into the middle of the file!)
43
+ #`['INIT' is a phaser, it makes sure that the test data is available before everything else
44
+ starts running (otherwise we'd have to shove the test data into the middle of the file!)]
46
45
  INIT {
47
- $c-data := from-json
48
- {
49
- "exercise": "bob",
50
- "version": "1.0.0",
51
- "cases": [
52
- {
53
- "description": "stating something",
54
- "property": "response",
55
- "input": "Tom-ay-to, tom-aaaah-to.",
56
- "expected": "Whatever."
57
- },
58
- {
59
- "description": "shouting",
60
- "property": "response",
61
- "input": "WATCH OUT!",
62
- "expected": "Whoa, chill out!"
63
- },
64
- {
65
- "description": "shouting gibberish",
66
- "property": "response",
67
- "input": "FCECDFCAAB",
68
- "expected": "Whoa, chill out!"
69
- },
70
- {
71
- "description": "asking a question",
72
- "property": "response",
73
- "input": "Does this cryogenic chamber make me look fat?",
74
- "expected": "Sure."
75
- },
76
- {
77
- "description": "asking a numeric question",
78
- "property": "response",
79
- "input": "You are, what, like 15?",
80
- "expected": "Sure."
81
- },
82
- {
83
- "description": "asking gibberish",
84
- "property": "response",
85
- "input": "fffbbcbeab?",
86
- "expected": "Sure."
87
- },
88
- {
89
- "description": "talking forcefully",
90
- "property": "response",
91
- "input": "Let's go make out behind the gym!",
92
- "expected": "Whatever."
93
- },
94
- {
95
- "description": "using acronyms in regular speech",
96
- "property": "response",
97
- "input": "It's OK if you don't want to go to the DMV.",
98
- "expected": "Whatever."
99
- },
100
- {
101
- "description": "forceful question",
102
- "property": "response",
103
- "input": "WHAT THE HELL WERE YOU THINKING?",
104
- "expected": "Whoa, chill out!"
105
- },
106
- {
107
- "description": "shouting numbers",
108
- "property": "response",
109
- "input": "1, 2, 3 GO!",
110
- "expected": "Whoa, chill out!"
111
- },
112
- {
113
- "description": "only numbers",
114
- "property": "response",
115
- "input": "1, 2, 3",
116
- "expected": "Whatever."
117
- },
118
- {
119
- "description": "question with only numbers",
120
- "property": "response",
121
- "input": "4?",
122
- "expected": "Sure."
123
- },
124
- {
125
- "description": "shouting with special characters",
126
- "property": "response",
127
- "input": "ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!",
128
- "expected": "Whoa, chill out!"
129
- },
130
- {
131
- "description": "shouting with no exclamation mark",
132
- "property": "response",
133
- "input": "I HATE YOU",
134
- "expected": "Whoa, chill out!"
135
- },
136
- {
137
- "description": "statement containing question mark",
138
- "property": "response",
139
- "input": "Ending with ? means a question.",
140
- "expected": "Whatever."
141
- },
142
- {
143
- "description": "non-letters with question",
144
- "property": "response",
145
- "input": ":) ?",
146
- "expected": "Sure."
147
- },
148
- {
149
- "description": "prattling on",
150
- "property": "response",
151
- "input": "Wait! Hang on. Are you going to be OK?",
152
- "expected": "Sure."
153
- },
154
- {
155
- "description": "silence",
156
- "property": "response",
157
- "input": "",
158
- "expected": "Fine. Be that way!"
159
- },
160
- {
161
- "description": "prolonged silence",
162
- "property": "response",
163
- "input": " ",
164
- "expected": "Fine. Be that way!"
165
- },
166
- {
167
- "description": "alternate silence",
168
- "property": "response",
169
- "input": "\t\t\t\t\t\t\t\t\t\t",
170
- "expected": "Fine. Be that way!"
171
- },
172
- {
173
- "description": "multiple line question",
174
- "property": "response",
175
- "input": "\nDoes this cryogenic chamber make me look fat?\nno",
176
- "expected": "Whatever."
177
- },
178
- {
179
- "description": "starting with whitespace",
180
- "property": "response",
181
- "input": " hmmmmmmm...",
182
- "expected": "Whatever."
183
- },
184
- {
185
- "description": "ending with whitespace",
186
- "property": "response",
187
- "input": "Okay if like my spacebar quite a bit? ",
188
- "expected": "Sure."
189
- },
190
- {
191
- "description": "other whitespace",
192
- "property": "response",
193
- "input": "\n\r \t",
194
- "expected": "Fine. Be that way!"
195
- },
196
- {
197
- "description": "non-question ending with whitespace",
198
- "property": "response",
199
- "input": "This is a statement ending with whitespace ",
200
- "expected": "Whatever."
201
- }
202
- ]
46
+ $c-data := from-json q:to/END/;
47
+
48
+ {
49
+ "exercise": "bob",
50
+ "version": "1.0.0",
51
+ "cases": [
52
+ {
53
+ "description": "stating something",
54
+ "property": "response",
55
+ "input": "Tom-ay-to, tom-aaaah-to.",
56
+ "expected": "Whatever."
57
+ },
58
+ {
59
+ "description": "shouting",
60
+ "property": "response",
61
+ "input": "WATCH OUT!",
62
+ "expected": "Whoa, chill out!"
63
+ },
64
+ {
65
+ "description": "shouting gibberish",
66
+ "property": "response",
67
+ "input": "FCECDFCAAB",
68
+ "expected": "Whoa, chill out!"
69
+ },
70
+ {
71
+ "description": "asking a question",
72
+ "property": "response",
73
+ "input": "Does this cryogenic chamber make me look fat?",
74
+ "expected": "Sure."
75
+ },
76
+ {
77
+ "description": "asking a numeric question",
78
+ "property": "response",
79
+ "input": "You are, what, like 15?",
80
+ "expected": "Sure."
81
+ },
82
+ {
83
+ "description": "asking gibberish",
84
+ "property": "response",
85
+ "input": "fffbbcbeab?",
86
+ "expected": "Sure."
87
+ },
88
+ {
89
+ "description": "talking forcefully",
90
+ "property": "response",
91
+ "input": "Let's go make out behind the gym!",
92
+ "expected": "Whatever."
93
+ },
94
+ {
95
+ "description": "using acronyms in regular speech",
96
+ "property": "response",
97
+ "input": "It's OK if you don't want to go to the DMV.",
98
+ "expected": "Whatever."
99
+ },
100
+ {
101
+ "description": "forceful question",
102
+ "property": "response",
103
+ "input": "WHAT THE HELL WERE YOU THINKING?",
104
+ "expected": "Whoa, chill out!"
105
+ },
106
+ {
107
+ "description": "shouting numbers",
108
+ "property": "response",
109
+ "input": "1, 2, 3 GO!",
110
+ "expected": "Whoa, chill out!"
111
+ },
112
+ {
113
+ "description": "only numbers",
114
+ "property": "response",
115
+ "input": "1, 2, 3",
116
+ "expected": "Whatever."
117
+ },
118
+ {
119
+ "description": "question with only numbers",
120
+ "property": "response",
121
+ "input": "4?",
122
+ "expected": "Sure."
123
+ },
124
+ {
125
+ "description": "shouting with special characters",
126
+ "property": "response",
127
+ "input": "ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!",
128
+ "expected": "Whoa, chill out!"
129
+ },
130
+ {
131
+ "description": "shouting with no exclamation mark",
132
+ "property": "response",
133
+ "input": "I HATE YOU",
134
+ "expected": "Whoa, chill out!"
135
+ },
136
+ {
137
+ "description": "statement containing question mark",
138
+ "property": "response",
139
+ "input": "Ending with ? means a question.",
140
+ "expected": "Whatever."
141
+ },
142
+ {
143
+ "description": "non-letters with question",
144
+ "property": "response",
145
+ "input": ":) ?",
146
+ "expected": "Sure."
147
+ },
148
+ {
149
+ "description": "prattling on",
150
+ "property": "response",
151
+ "input": "Wait! Hang on. Are you going to be OK?",
152
+ "expected": "Sure."
153
+ },
154
+ {
155
+ "description": "silence",
156
+ "property": "response",
157
+ "input": "",
158
+ "expected": "Fine. Be that way!"
159
+ },
160
+ {
161
+ "description": "prolonged silence",
162
+ "property": "response",
163
+ "input": " ",
164
+ "expected": "Fine. Be that way!"
165
+ },
166
+ {
167
+ "description": "alternate silence",
168
+ "property": "response",
169
+ "input": "\t\t\t\t\t\t\t\t\t\t",
170
+ "expected": "Fine. Be that way!"
171
+ },
172
+ {
173
+ "description": "multiple line question",
174
+ "property": "response",
175
+ "input": "\nDoes this cryogenic chamber make me look fat?\nno",
176
+ "expected": "Whatever."
177
+ },
178
+ {
179
+ "description": "starting with whitespace",
180
+ "property": "response",
181
+ "input": " hmmmmmmm...",
182
+ "expected": "Whatever."
183
+ },
184
+ {
185
+ "description": "ending with whitespace",
186
+ "property": "response",
187
+ "input": "Okay if like my spacebar quite a bit? ",
188
+ "expected": "Sure."
189
+ },
190
+ {
191
+ "description": "other whitespace",
192
+ "property": "response",
193
+ "input": "\n\r \t",
194
+ "expected": "Fine. Be that way!"
195
+ },
196
+ {
197
+ "description": "non-question ending with whitespace",
198
+ "property": "response",
199
+ "input": "This is a statement ending with whitespace ",
200
+ "expected": "Whatever."
203
201
  }
204
-
202
+ ]
203
+ }
204
+
205
+ END
205
206
  }