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.
- checksums.yaml +4 -4
- data/common/exercises/perfect-numbers/description.md +2 -2
- data/common/exercises/phone-number/canonical-data.json +1 -7
- data/common/exercises/tournament/canonical-data.json +96 -21
- data/common/exercises/tournament/description.md +0 -5
- data/lib/trackler/version.rb +1 -1
- data/tracks/coq/README.md +6 -8
- data/tracks/coq/exercises/hello-world/example.v +3 -0
- data/tracks/coq/exercises/hello-world/hello-world.v +3 -0
- data/tracks/coq/exercises/rna-transcription/DNA.v +4 -0
- data/tracks/coq/exercises/rna-transcription/example.v +15 -0
- data/tracks/coq/exercises/rna-transcription/rna-transcription.v +5 -0
- data/tracks/coq/exercises/tautology/description.md +1 -0
- data/tracks/coq/exercises/tautology/example.v +4 -0
- data/tracks/coq/exercises/tautology/tautology.v +4 -0
- data/tracks/haskell/exercises/accumulate/package.yaml +1 -0
- data/tracks/haskell/exercises/accumulate/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/acronym/package.yaml +1 -0
- data/tracks/haskell/exercises/acronym/test/Tests.hs +0 -5
- data/tracks/haskell/exercises/all-your-base/package.yaml +1 -0
- data/tracks/haskell/exercises/all-your-base/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/allergies/package.yaml +1 -0
- data/tracks/haskell/exercises/allergies/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/alphametics/package.yaml +1 -0
- data/tracks/haskell/exercises/alphametics/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/anagram/package.yaml +1 -0
- data/tracks/haskell/exercises/anagram/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/atbash-cipher/package.yaml +1 -0
- data/tracks/haskell/exercises/atbash-cipher/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/bank-account/package.yaml +1 -0
- data/tracks/haskell/exercises/bank-account/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/beer-song/package.yaml +1 -0
- data/tracks/haskell/exercises/binary/package.yaml +1 -0
- data/tracks/haskell/exercises/binary/test/Tests.hs +0 -1
- data/tracks/haskell/exercises/binary-search-tree/package.yaml +1 -0
- data/tracks/haskell/exercises/binary-search-tree/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/bob/package.yaml +1 -0
- data/tracks/haskell/exercises/bob/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/bowling/package.yaml +1 -0
- data/tracks/haskell/exercises/bowling/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/bracket-push/package.yaml +1 -0
- data/tracks/haskell/exercises/bracket-push/test/Tests.hs +1 -6
- data/tracks/haskell/exercises/change/package.yaml +1 -0
- data/tracks/haskell/exercises/change/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/clock/package.yaml +1 -0
- data/tracks/haskell/exercises/clock/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/connect/package.yaml +1 -0
- data/tracks/haskell/exercises/connect/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/crypto-square/package.yaml +1 -0
- data/tracks/haskell/exercises/crypto-square/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/custom-set/package.yaml +1 -0
- data/tracks/haskell/exercises/custom-set/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/difference-of-squares/package.yaml +1 -0
- data/tracks/haskell/exercises/difference-of-squares/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/dominoes/package.yaml +1 -0
- data/tracks/haskell/exercises/dominoes/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/etl/package.yaml +1 -0
- data/tracks/haskell/exercises/etl/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/food-chain/package.yaml +1 -0
- data/tracks/haskell/exercises/forth/package.yaml +1 -0
- data/tracks/haskell/exercises/forth/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/gigasecond/package.yaml +1 -0
- data/tracks/haskell/exercises/gigasecond/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/go-counting/package.yaml +1 -0
- data/tracks/haskell/exercises/go-counting/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/grade-school/package.yaml +1 -0
- data/tracks/haskell/exercises/grade-school/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/grains/package.yaml +1 -0
- data/tracks/haskell/exercises/grains/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/hamming/package.yaml +1 -0
- data/tracks/haskell/exercises/hamming/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/hello-world/package.yaml +1 -0
- data/tracks/haskell/exercises/hexadecimal/package.yaml +1 -0
- data/tracks/haskell/exercises/hexadecimal/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/house/package.yaml +1 -0
- data/tracks/haskell/exercises/kindergarten-garden/package.yaml +1 -0
- data/tracks/haskell/exercises/kindergarten-garden/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/largest-series-product/package.yaml +1 -0
- data/tracks/haskell/exercises/largest-series-product/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/leap/package.yaml +1 -0
- data/tracks/haskell/exercises/leap/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/lens-person/package.yaml +1 -0
- data/tracks/haskell/exercises/lens-person/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/linked-list/package.yaml +1 -0
- data/tracks/haskell/exercises/linked-list/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/list-ops/package.yaml +1 -0
- data/tracks/haskell/exercises/list-ops/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/luhn/package.yaml +1 -0
- data/tracks/haskell/exercises/luhn/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/matrix/package.yaml +1 -0
- data/tracks/haskell/exercises/matrix/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/meetup/package.yaml +1 -0
- data/tracks/haskell/exercises/meetup/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/minesweeper/package.yaml +1 -0
- data/tracks/haskell/exercises/minesweeper/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/nth-prime/package.yaml +1 -0
- data/tracks/haskell/exercises/nth-prime/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/nucleotide-count/package.yaml +1 -0
- data/tracks/haskell/exercises/nucleotide-count/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/ocr-numbers/package.yaml +1 -0
- data/tracks/haskell/exercises/ocr-numbers/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/octal/package.yaml +1 -0
- data/tracks/haskell/exercises/octal/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/palindrome-products/package.yaml +1 -0
- data/tracks/haskell/exercises/palindrome-products/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/pangram/package.yaml +1 -0
- data/tracks/haskell/exercises/pangram/test/Tests.hs +0 -5
- data/tracks/haskell/exercises/parallel-letter-frequency/package.yaml +1 -0
- data/tracks/haskell/exercises/parallel-letter-frequency/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/pascals-triangle/package.yaml +1 -0
- data/tracks/haskell/exercises/pascals-triangle/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/phone-number/package.yaml +1 -0
- data/tracks/haskell/exercises/phone-number/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/pig-latin/package.yaml +1 -0
- data/tracks/haskell/exercises/pig-latin/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/pov/package.yaml +1 -0
- data/tracks/haskell/exercises/pov/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/prime-factors/package.yaml +1 -0
- data/tracks/haskell/exercises/prime-factors/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/pythagorean-triplet/package.yaml +1 -0
- data/tracks/haskell/exercises/pythagorean-triplet/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/queen-attack/package.yaml +1 -0
- data/tracks/haskell/exercises/queen-attack/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/raindrops/package.yaml +1 -0
- data/tracks/haskell/exercises/raindrops/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/rna-transcription/package.yaml +1 -0
- data/tracks/haskell/exercises/rna-transcription/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/robot-name/package.yaml +1 -0
- data/tracks/haskell/exercises/robot-name/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/robot-simulator/package.yaml +1 -0
- data/tracks/haskell/exercises/robot-simulator/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/roman-numerals/package.yaml +1 -0
- data/tracks/haskell/exercises/roman-numerals/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/run-length-encoding/package.yaml +1 -0
- data/tracks/haskell/exercises/run-length-encoding/test/Tests.hs +0 -4
- data/tracks/haskell/exercises/saddle-points/package.yaml +1 -0
- data/tracks/haskell/exercises/saddle-points/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/say/package.yaml +1 -0
- data/tracks/haskell/exercises/say/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/scrabble-score/package.yaml +1 -0
- data/tracks/haskell/exercises/scrabble-score/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/secret-handshake/package.yaml +1 -0
- data/tracks/haskell/exercises/secret-handshake/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/series/package.yaml +1 -0
- data/tracks/haskell/exercises/series/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/sgf-parsing/package.yaml +1 -0
- data/tracks/haskell/exercises/sgf-parsing/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/sieve/package.yaml +1 -0
- data/tracks/haskell/exercises/sieve/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/simple-cipher/package.yaml +1 -0
- data/tracks/haskell/exercises/simple-cipher/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/simple-linked-list/package.yaml +1 -0
- data/tracks/haskell/exercises/simple-linked-list/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/space-age/package.yaml +1 -0
- data/tracks/haskell/exercises/space-age/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/strain/package.yaml +1 -0
- data/tracks/haskell/exercises/strain/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/sublist/package.yaml +1 -0
- data/tracks/haskell/exercises/sublist/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/sum-of-multiples/package.yaml +1 -0
- data/tracks/haskell/exercises/sum-of-multiples/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/triangle/package.yaml +1 -0
- data/tracks/haskell/exercises/triangle/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/trinary/package.yaml +1 -0
- data/tracks/haskell/exercises/trinary/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/word-count/package.yaml +1 -0
- data/tracks/haskell/exercises/word-count/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/wordy/package.yaml +1 -0
- data/tracks/haskell/exercises/wordy/test/Tests.hs +0 -2
- data/tracks/haskell/exercises/zebra-puzzle/package.yaml +1 -0
- data/tracks/haskell/exercises/zipper/package.yaml +1 -0
- data/tracks/haskell/exercises/zipper/test/Tests.hs +0 -3
- data/tracks/java/exercises/book-store/src/test/java/BookstoreTest.java +12 -12
- data/tracks/java/exercises/ocr-numbers/src/test/java/OpticalCharacterReaderTest.java +16 -16
- data/tracks/java/exercises/strain/src/test/java/StrainTest.java +11 -11
- data/tracks/perl6/README.md +12 -0
- data/tracks/perl6/bin/README.md +3 -0
- data/tracks/perl6/config.json +20 -20
- data/tracks/perl6/exercises/accumulate/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/all-your-base/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/allergies/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/anagram/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/atbash-cipher/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/binary/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/bob/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/bob/bob.t +181 -180
- data/tracks/perl6/exercises/bob/example.yaml +1 -0
- data/tracks/perl6/exercises/grade-school/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/grade-school/grade-school.t +9 -18
- data/tracks/perl6/exercises/grains/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/hello-world/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/hello-world/example.yaml +1 -0
- data/tracks/perl6/exercises/hello-world/hello-world.t +38 -43
- data/tracks/perl6/exercises/leap/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/leap/leap.t +40 -42
- data/tracks/perl6/exercises/phone-number/{Example.pm → Example.pm6} +2 -2
- data/tracks/perl6/exercises/phone-number/PhoneNumber.pm6 +1 -1
- data/tracks/perl6/exercises/phone-number/example.yaml +2 -2
- data/tracks/perl6/exercises/phone-number/phone-number.t +3 -9
- data/tracks/perl6/exercises/raindrops/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/rna-transcription/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/robot-name/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/scrabble-score/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/space-age/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/trinary/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/word-count/{Example.pm → Example.pm6} +0 -0
- data/tracks/perl6/exercises/wordy/{Example.pm → Example.pm6} +0 -0
- data/tracks/python/.github/stale.yml +4 -4
- data/tracks/python/config.json +24 -0
- data/tracks/python/exercises/alphametics/alphametics.py +2 -0
- data/tracks/python/exercises/alphametics/alphametics_test.py +71 -0
- data/tracks/python/exercises/alphametics/example.py +29 -0
- data/tracks/python/exercises/book-store/book_store.py +2 -0
- data/tracks/python/exercises/book-store/book_store_test.py +72 -0
- data/tracks/python/exercises/book-store/example.py +29 -0
- data/tracks/python/exercises/meetup/meetup_test.py +341 -1
- data/tracks/python/exercises/tournament/example.py +45 -0
- data/tracks/python/exercises/tournament/tournament.py +2 -0
- data/tracks/python/exercises/tournament/tournament_test.py +70 -0
- data/tracks/python/exercises/variable-length-quantity/example.py +34 -0
- data/tracks/python/exercises/variable-length-quantity/variable_length_quantity.py +6 -0
- data/tracks/python/exercises/variable-length-quantity/variable_length_quantity_test.py +100 -0
- data/tracks/r/config.json +23 -23
- data/tracks/r/exercises/perfect-numbers/test_perfect-numbers.R +1 -1
- data/tracks/r/exercises/prime-factors/test_prime-factors.R +2 -0
- data/tracks/r/exercises/tournament/example.R +2 -5
- data/tracks/scala/exercises/leap/example.scala +4 -4
- data/tracks/scala/exercises/leap/src/main/scala/Leap.scala +3 -0
- data/tracks/scala/exercises/leap/src/test/scala/LeapTest.scala +6 -6
- 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(
|
data/tracks/perl6/README.md
CHANGED
@@ -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)
|
data/tracks/perl6/bin/README.md
CHANGED
@@ -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
|
data/tracks/perl6/config.json
CHANGED
@@ -26,27 +26,22 @@
|
|
26
26
|
},
|
27
27
|
{
|
28
28
|
"difficulty": 1,
|
29
|
-
"slug": "
|
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": "
|
34
|
+
"slug": "bob",
|
40
35
|
"topics": []
|
41
36
|
},
|
42
37
|
{
|
43
38
|
"difficulty": 1,
|
44
|
-
"slug": "
|
39
|
+
"slug": "phone-number",
|
45
40
|
"topics": []
|
46
41
|
},
|
47
42
|
{
|
48
43
|
"difficulty": 1,
|
49
|
-
"slug": "
|
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": "
|
54
|
+
"slug": "wordy",
|
60
55
|
"topics": []
|
61
56
|
},
|
62
57
|
{
|
63
58
|
"difficulty": 1,
|
64
|
-
"slug": "
|
59
|
+
"slug": "raindrops",
|
65
60
|
"topics": []
|
66
61
|
},
|
67
62
|
{
|
68
63
|
"difficulty": 1,
|
69
|
-
"slug": "
|
64
|
+
"slug": "scrabble-score",
|
70
65
|
"topics": []
|
71
66
|
},
|
72
67
|
{
|
73
68
|
"difficulty": 1,
|
74
|
-
"slug": "
|
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": "
|
79
|
+
"slug": "accumulate",
|
85
80
|
"topics": []
|
86
81
|
},
|
87
82
|
{
|
88
83
|
"difficulty": 1,
|
89
|
-
"slug": "
|
84
|
+
"slug": "grains",
|
90
85
|
"topics": []
|
91
86
|
},
|
92
87
|
{
|
93
88
|
"difficulty": 1,
|
94
|
-
"slug": "
|
89
|
+
"slug": "all-your-base",
|
95
90
|
"topics": []
|
96
91
|
},
|
97
92
|
{
|
98
93
|
"difficulty": 1,
|
99
|
-
"slug": "
|
94
|
+
"slug": "anagram",
|
100
95
|
"topics": []
|
101
96
|
},
|
102
97
|
{
|
103
98
|
"difficulty": 1,
|
104
|
-
"slug": "
|
99
|
+
"slug": "robot-name",
|
105
100
|
"topics": []
|
106
101
|
},
|
107
102
|
{
|
108
103
|
"difficulty" : 1,
|
109
|
-
"slug" : "
|
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",
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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;
|
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';
|
8
|
-
my $version = v1;
|
9
|
-
my $module = %*ENV<EXERCISM> ?? 'Example' !! $exercise;
|
10
|
-
plan 28;
|
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
|
-
|
12
|
+
#`[Check that the module can be use-d.]
|
13
13
|
use-ok $module or bail-out;
|
14
14
|
require ::($module);
|
15
15
|
|
16
|
-
|
17
|
-
|
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
|
-
|
26
|
-
|
27
|
-
subtest 'Class
|
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
|
-
|
33
|
-
|
34
|
-
|
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
|
-
|
37
|
-
if %*ENV<EXERCISM> && (my $c-data-file =
|
38
|
-
|
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
|
-
|
42
|
-
done-testing;
|
41
|
+
done-testing; #`[There are no more tests after this :)]
|
43
42
|
|
44
|
-
|
45
|
-
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
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
|
}
|