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.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/kindergarten-garden/canonical-data.json +37 -19
- data/problem-specifications/exercises/ocr-numbers/canonical-data.json +144 -110
- data/problem-specifications/exercises/palindrome-products/canonical-data.json +49 -25
- data/problem-specifications/exercises/poker/canonical-data.json +171 -115
- data/problem-specifications/exercises/prime-factors/canonical-data.json +22 -8
- data/problem-specifications/exercises/protein-translation/canonical-data.json +70 -24
- data/problem-specifications/exercises/proverb/canonical-data.json +24 -12
- data/problem-specifications/exercises/queen-attack/canonical-data.json +115 -91
- data/problem-specifications/exercises/rail-fence-cipher/canonical-data.json +25 -13
- data/problem-specifications/exercises/raindrops/canonical-data.json +55 -19
- data/problem-specifications/exercises/rational-numbers/canonical-data.json +374 -0
- data/problem-specifications/exercises/rational-numbers/description.md +27 -0
- data/problem-specifications/exercises/rational-numbers/metadata.yml +4 -0
- data/problem-specifications/exercises/rectangles/canonical-data.json +93 -67
- data/problem-specifications/exercises/reverse-string/canonical-data.json +16 -6
- data/problem-specifications/exercises/rna-transcription/metadata.yml +3 -3
- data/problem-specifications/exercises/roman-numerals/canonical-data.json +10 -2
- data/tracks/bash/config.json +11 -11
- data/tracks/c/exercises/roman-numerals/test/test_roman_numerals.c +7 -0
- data/tracks/clojure/exercises/armstrong-numbers/README.md +1 -1
- data/tracks/delphi/config.json +11 -0
- data/tracks/delphi/exercises/clock/uClockExample.pas +6 -1
- data/tracks/delphi/exercises/clock/uClockTest.pas +22 -19
- data/tracks/delphi/exercises/isbn-verifier/README.md +1 -1
- data/tracks/delphi/exercises/reverse-string/README.md +1 -1
- data/tracks/delphi/exercises/rna-transcription/README.md +1 -1
- data/tracks/delphi/exercises/roman-numerals/uRomanNumeralsTest.pas +14 -0
- data/tracks/delphi/exercises/space-age/README.md +45 -0
- data/tracks/delphi/exercises/space-age/SpaceAge.dpr +60 -0
- data/tracks/delphi/exercises/space-age/uSpaceAgeExample.pas +120 -0
- data/tracks/delphi/exercises/space-age/uSpaceAgeTests.pas +135 -0
- data/tracks/delphi/exercises/two-fer/README.md +1 -1
- data/tracks/elixir/exercises/nth-prime/nth_prime.exs +0 -1
- data/tracks/fsharp/exercises/pov/PovTest.fs +66 -53
- data/tracks/fsharp/exercises/space-age/Example.fs +11 -11
- data/tracks/fsharp/exercises/space-age/SpaceAge.fs +1 -1
- data/tracks/fsharp/exercises/space-age/SpaceAgeTest.fs +21 -34
- data/tracks/fsharp/exercises/triangle/Example.fs +11 -16
- data/tracks/fsharp/exercises/triangle/Triangle.fs +4 -5
- data/tracks/fsharp/exercises/triangle/TriangleTest.fs +44 -31
- data/tracks/fsharp/generators/Generators.fs +121 -0
- data/tracks/go/config.json +12 -0
- data/tracks/go/exercises/clock/.meta/gen.go +37 -13
- data/tracks/go/exercises/clock/cases_test.go +10 -10
- data/tracks/go/exercises/clock/clock_test.go +16 -2
- data/tracks/go/exercises/clock/example.go +4 -0
- data/tracks/go/exercises/clock/example_clock_test.go +3 -3
- data/tracks/go/exercises/parallel-letter-frequency/.meta/hints.md +33 -0
- data/tracks/go/exercises/parallel-letter-frequency/README.md +35 -0
- data/tracks/go/exercises/raindrops/.meta/hints.md +7 -4
- data/tracks/go/exercises/raindrops/README.md +12 -0
- data/tracks/go/exercises/roman-numerals/.meta/gen.go +4 -2
- data/tracks/go/exercises/roman-numerals/cases_test.go +3 -2
- data/tracks/go/exercises/space-age/.meta/hints.md +10 -0
- data/tracks/go/exercises/space-age/README.md +14 -1
- data/tracks/go/exercises/twelve-days/README.md +2 -5
- data/tracks/go/exercises/two-bucket/.meta/gen.go +62 -0
- data/tracks/go/exercises/two-bucket/.meta/hints.md +16 -0
- data/tracks/go/exercises/two-bucket/README.md +72 -0
- data/tracks/go/exercises/two-bucket/cases_test.go +44 -0
- data/tracks/go/exercises/two-bucket/example.go +198 -0
- data/tracks/go/exercises/two-bucket/two_bucket_test.go +61 -0
- data/tracks/idris/.travis.yml +3 -2
- data/tracks/idris/bin/fetch-idris-testing.sh +11 -0
- data/tracks/idris/bin/solve_exercises.sh +2 -2
- data/tracks/idris/config.json +11 -0
- data/tracks/idris/config/exercise_readme.go.tmpl +0 -3
- data/tracks/idris/docs/INSTALLATION.md +22 -0
- data/tracks/idris/docs/TESTS.md +12 -4
- data/tracks/idris/exercises/accumulate/src/Accumulate.idr +5 -0
- data/tracks/idris/exercises/hamming/Hamming.ipkg +2 -0
- data/tracks/idris/exercises/hamming/src/{example.idr → Example.idr} +5 -1
- data/tracks/idris/exercises/hamming/src/Hamming.idr +13 -5
- data/tracks/idris/exercises/hamming/src/Test/Hamming.idr +31 -58
- data/tracks/idris/exercises/hello-world/HelloWorld.ipkg +2 -0
- data/tracks/idris/exercises/hello-world/src/Example.idr +9 -0
- data/tracks/idris/exercises/hello-world/src/HelloWorld.idr +6 -1
- data/tracks/idris/exercises/hello-world/src/Test/HelloWorld.idr +18 -18
- data/tracks/idris/exercises/leap/Leap.ipkg +2 -0
- data/tracks/idris/exercises/leap/src/{example.idr → Example.idr} +4 -0
- data/tracks/idris/exercises/leap/src/Leap.idr +5 -1
- data/tracks/idris/exercises/leap/src/Test/Leap.idr +21 -30
- data/tracks/idris/exercises/rna-transcription/Makefile +23 -0
- data/tracks/idris/exercises/rna-transcription/README.md +27 -0
- data/tracks/idris/exercises/rna-transcription/RnaTranscription.ipkg +5 -0
- data/tracks/idris/exercises/rna-transcription/src/RnaTranscription.idr +17 -0
- data/tracks/idris/exercises/rna-transcription/src/Test/RnaTranscription.idr +27 -0
- data/tracks/idris/exercises/rna-transcription/src/example.idr +35 -0
- data/tracks/java/exercises/etl/.meta/version +1 -0
- data/tracks/java/exercises/gigasecond/.meta/version +1 -0
- data/tracks/java/exercises/isbn-verifier/README.md +1 -1
- data/tracks/java/exercises/nucleotide-count/.meta/src/reference/java/NucleotideCounter.java +7 -1
- data/tracks/java/exercises/nucleotide-count/.meta/version +1 -0
- data/tracks/java/exercises/nucleotide-count/src/test/java/NucleotideCounterTest.java +19 -54
- data/tracks/java/exercises/proverb/.meta/version +1 -0
- data/tracks/java/exercises/reverse-string/README.md +1 -1
- data/tracks/java/exercises/rna-transcription/README.md +1 -1
- data/tracks/java/exercises/sum-of-multiples/.meta/version +1 -0
- data/tracks/java/exercises/sum-of-multiples/src/test/java/SumOfMultiplesTest.java +13 -1
- data/tracks/kotlin/config/exercise_readme.go.tmpl +0 -3
- data/tracks/kotlin/docs/TESTS.md +1 -1
- data/tracks/objective-c/config.json +11 -0
- data/tracks/objective-c/exercises/collatz-conjecture/CollatzConjectureExample.h +7 -0
- data/tracks/objective-c/exercises/collatz-conjecture/CollatzConjectureExample.m +26 -0
- data/tracks/objective-c/exercises/collatz-conjecture/CollatzConjectureTest.m +39 -0
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.pbxproj +31 -1
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/OCLint.xcscheme +3 -1
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/xobjectivecTest.xcscheme +3 -1
- data/tracks/ocaml/exercises/forth/example.ml +9 -9
- data/tracks/ocaml/tools/test-generator/Makefile +3 -9
- data/tracks/ocaml/tools/test-generator/src/test_gen.ml +18 -16
- data/tracks/perl6/exercises/acronym/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/acronym/acronym.t +4 -14
- data/tracks/perl6/exercises/all-your-base/all-your-base.t +0 -2
- data/tracks/perl6/exercises/allergies/allergies.t +0 -2
- data/tracks/perl6/exercises/anagram/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/anagram/anagram.t +2 -40
- data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +0 -1
- data/tracks/perl6/exercises/bob/bob.t +0 -2
- data/tracks/perl6/exercises/clock/.meta/exercise-data.yaml +15 -11
- data/tracks/perl6/exercises/clock/.meta/solutions/Clock.pm6 +5 -1
- data/tracks/perl6/exercises/clock/Clock.pm6 +1 -1
- data/tracks/perl6/exercises/clock/clock.t +314 -217
- data/tracks/perl6/exercises/etl/etl.t +0 -2
- data/tracks/perl6/exercises/flatten-array/flatten-array.t +0 -2
- data/tracks/perl6/exercises/grains/grains.t +0 -2
- data/tracks/perl6/exercises/hamming/.meta/exercise-data.yaml +2 -2
- data/tracks/perl6/exercises/hamming/hamming.t +63 -35
- data/tracks/perl6/exercises/hello-world/hello-world.t +2 -3
- data/tracks/perl6/exercises/leap/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/leap/leap.t +14 -8
- data/tracks/perl6/exercises/luhn/luhn.t +0 -2
- data/tracks/perl6/exercises/nucleotide-count/.meta/exercise-data.yaml +2 -2
- data/tracks/perl6/exercises/nucleotide-count/nucleotide-count.t +18 -10
- data/tracks/perl6/exercises/pangram/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/pangram/pangram.t +32 -14
- data/tracks/perl6/exercises/phone-number/.meta/exercise-data.yaml +4 -4
- data/tracks/perl6/exercises/phone-number/.meta/solutions/Phone.pm6 +1 -1
- data/tracks/perl6/exercises/phone-number/Phone.pm6 +1 -1
- data/tracks/perl6/exercises/phone-number/phone-number.t +59 -21
- data/tracks/perl6/exercises/raindrops/raindrops.t +0 -2
- data/tracks/perl6/exercises/rna-transcription/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/rna-transcription/README.md +1 -1
- data/tracks/perl6/exercises/rna-transcription/rna-transcription.t +17 -9
- data/tracks/perl6/exercises/roman-numerals/.meta/exercise-data.yaml +3 -3
- data/tracks/perl6/exercises/roman-numerals/.meta/solutions/RomanNumerals.pm6 +1 -1
- data/tracks/perl6/exercises/roman-numerals/RomanNumerals.pm6 +1 -1
- data/tracks/perl6/exercises/roman-numerals/roman-numerals.t +66 -24
- data/tracks/perl6/exercises/scrabble-score/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/scrabble-score/scrabble-score.t +35 -15
- data/tracks/perl6/exercises/space-age/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/space-age/space-age.t +34 -20
- data/tracks/perl6/exercises/two-fer/.meta/exercise-data.yaml +2 -2
- data/tracks/perl6/exercises/two-fer/two-fer.t +15 -11
- data/tracks/perl6/exercises/word-count/.meta/exercise-data.yaml +1 -1
- data/tracks/perl6/exercises/word-count/word-count.t +46 -26
- data/tracks/perl6/exercises/wordy/.meta/exercise-data.yaml +2 -2
- data/tracks/perl6/exercises/wordy/wordy.t +51 -21
- data/tracks/perl6/lib/Exercism/Generator.pm6 +1 -1
- data/tracks/perl6/t/generated-tests.t +1 -1
- data/tracks/perl6/templates/test.mustache +0 -1
- data/tracks/python/config.json +12 -0
- data/tracks/python/exercises/forth/example.py +1 -1
- data/tracks/python/exercises/forth/forth_test.py +43 -38
- data/tracks/python/exercises/spiral-matrix/README.md +42 -0
- data/tracks/python/exercises/spiral-matrix/example.py +11 -0
- data/tracks/python/exercises/spiral-matrix/spiral_matrix.py +2 -0
- data/tracks/python/exercises/spiral-matrix/spiral_matrix_test.py +40 -0
- data/tracks/racket/config/exercise_readme.go.tmpl +24 -4
- data/tracks/racket/exercises/accumulate/README.md +3 -6
- data/tracks/racket/exercises/acronym/README.md +3 -4
- data/tracks/racket/exercises/allergies/README.md +3 -4
- data/tracks/racket/exercises/anagram/README.md +3 -3
- data/tracks/racket/exercises/bob/README.md +5 -3
- data/tracks/racket/exercises/collatz-conjecture/README.md +3 -3
- data/tracks/racket/exercises/difference-of-squares/README.md +3 -3
- data/tracks/racket/exercises/etl/README.md +6 -4
- data/tracks/racket/exercises/gigasecond/README.md +3 -3
- data/tracks/racket/exercises/grains/README.md +3 -4
- data/tracks/racket/exercises/grep/README.md +15 -15
- data/tracks/racket/exercises/hamming/README.md +3 -3
- data/tracks/racket/exercises/hello-world/README.md +1 -1
- data/tracks/racket/exercises/leap/README.md +4 -4
- data/tracks/racket/exercises/list-ops/README.md +3 -4
- data/tracks/racket/exercises/meetup/README.md +19 -15
- data/tracks/racket/exercises/nucleotide-count/README.md +11 -25
- data/tracks/racket/exercises/perfect-numbers/README.md +5 -5
- data/tracks/racket/exercises/phone-number/README.md +7 -6
- data/tracks/racket/exercises/raindrops/README.md +3 -3
- data/tracks/racket/exercises/rna-transcription/README.md +4 -4
- data/tracks/racket/exercises/roman-numerals/README.md +4 -4
- data/tracks/racket/exercises/say/README.md +3 -3
- data/tracks/racket/exercises/scrabble-score/README.md +6 -4
- data/tracks/racket/exercises/word-count/README.md +4 -5
- data/tracks/scheme/config/exercise_readme.go.tmpl +0 -3
- data/tracks/scheme/docs/INSTALLATION.md +23 -14
- metadata +40 -9
- data/tracks/idris/docs/EXERCISE_README_INSERT.md +0 -0
- data/tracks/idris/exercises/hello-world/src/example.idr +0 -5
- data/tracks/kotlin/config/exercise-readme-insert.md +0 -1
- data/tracks/racket/docs/EXERCISE_README_INSERT.md +0 -23
- data/tracks/scheme/docs/EXERCISE_README_INSERT.md +0 -0
@@ -19,7 +19,6 @@ is-deeply flatten-array(.<input><array>), |.<expected description> for @($c-data
|
|
19
19
|
|
20
20
|
=head2 Canonical Data
|
21
21
|
=begin code
|
22
|
-
|
23
22
|
{
|
24
23
|
"exercise": "flatten-array",
|
25
24
|
"version": "1.2.0",
|
@@ -74,5 +73,4 @@ is-deeply flatten-array(.<input><array>), |.<expected description> for @($c-data
|
|
74
73
|
}
|
75
74
|
]
|
76
75
|
}
|
77
|
-
|
78
76
|
=end code
|
@@ -26,7 +26,6 @@ is total-grains, |$c-data<cases>[1]<expected description>;
|
|
26
26
|
|
27
27
|
=head2 Canonical Data
|
28
28
|
=begin code
|
29
|
-
|
30
29
|
{
|
31
30
|
"exercise": "grains",
|
32
31
|
"version": "1.0.0",
|
@@ -108,5 +107,4 @@ is total-grains, |$c-data<cases>[1]<expected description>;
|
|
108
107
|
}
|
109
108
|
]
|
110
109
|
}
|
111
|
-
|
112
110
|
=end code
|
@@ -4,9 +4,9 @@ plan: 15
|
|
4
4
|
tests: |-
|
5
5
|
for $c-data<cases>.values {
|
6
6
|
if .<expected><error> {
|
7
|
-
throws-like {hamming-distance(|.<strand1 strand2>)}, Exception, .<description>;
|
7
|
+
throws-like {hamming-distance(|.<input><strand1 strand2>)}, Exception, .<description>;
|
8
8
|
} else {
|
9
|
-
is hamming-distance(|.<strand1 strand2>), |.<expected description>;
|
9
|
+
is hamming-distance(|.<input><strand1 strand2>), |.<expected description>;
|
10
10
|
}
|
11
11
|
}
|
12
12
|
|
@@ -17,18 +17,17 @@ if Hamming.^ver !~~ $version {
|
|
17
17
|
my $c-data = from-json $=pod.pop.contents;
|
18
18
|
for $c-data<cases>.values {
|
19
19
|
if .<expected><error> {
|
20
|
-
throws-like {hamming-distance(|.<strand1 strand2>)}, Exception, .<description>;
|
20
|
+
throws-like {hamming-distance(|.<input><strand1 strand2>)}, Exception, .<description>;
|
21
21
|
} else {
|
22
|
-
is hamming-distance(|.<strand1 strand2>), |.<expected description>;
|
22
|
+
is hamming-distance(|.<input><strand1 strand2>), |.<expected description>;
|
23
23
|
}
|
24
24
|
}
|
25
25
|
|
26
26
|
=head2 Canonical Data
|
27
27
|
=begin code
|
28
|
-
|
29
28
|
{
|
30
29
|
"exercise": "hamming",
|
31
|
-
"version": "2.0
|
30
|
+
"version": "2.1.0",
|
32
31
|
"comments": [
|
33
32
|
"Language implementations vary on the issue of unequal length strands.",
|
34
33
|
"A language may elect to simplify this task by only presenting equal",
|
@@ -45,109 +44,138 @@ for $c-data<cases>.values {
|
|
45
44
|
{
|
46
45
|
"description": "empty strands",
|
47
46
|
"property": "distance",
|
48
|
-
"
|
49
|
-
|
47
|
+
"input": {
|
48
|
+
"strand1": "",
|
49
|
+
"strand2": ""
|
50
|
+
},
|
50
51
|
"expected": 0
|
51
52
|
},
|
52
53
|
{
|
53
54
|
"description": "identical strands",
|
54
55
|
"property": "distance",
|
55
|
-
"
|
56
|
-
|
56
|
+
"input": {
|
57
|
+
"strand1": "A",
|
58
|
+
"strand2": "A"
|
59
|
+
},
|
57
60
|
"expected": 0
|
58
61
|
},
|
59
62
|
{
|
60
63
|
"description": "long identical strands",
|
61
64
|
"property": "distance",
|
62
|
-
"
|
63
|
-
|
65
|
+
"input": {
|
66
|
+
"strand1": "GGACTGA",
|
67
|
+
"strand2": "GGACTGA"
|
68
|
+
},
|
64
69
|
"expected": 0
|
65
70
|
},
|
66
71
|
{
|
67
72
|
"description": "complete distance in single nucleotide strands",
|
68
73
|
"property": "distance",
|
69
|
-
"
|
70
|
-
|
74
|
+
"input": {
|
75
|
+
"strand1": "A",
|
76
|
+
"strand2": "G"
|
77
|
+
},
|
71
78
|
"expected": 1
|
72
79
|
},
|
73
80
|
{
|
74
81
|
"description": "complete distance in small strands",
|
75
82
|
"property": "distance",
|
76
|
-
"
|
77
|
-
|
83
|
+
"input": {
|
84
|
+
"strand1": "AG",
|
85
|
+
"strand2": "CT"
|
86
|
+
},
|
78
87
|
"expected": 2
|
79
88
|
},
|
80
89
|
{
|
81
90
|
"description": "small distance in small strands",
|
82
91
|
"property": "distance",
|
83
|
-
"
|
84
|
-
|
92
|
+
"input": {
|
93
|
+
"strand1": "AT",
|
94
|
+
"strand2": "CT"
|
95
|
+
},
|
85
96
|
"expected": 1
|
86
97
|
},
|
87
98
|
{
|
88
99
|
"description": "small distance",
|
89
100
|
"property": "distance",
|
90
|
-
"
|
91
|
-
|
101
|
+
"input": {
|
102
|
+
"strand1": "GGACG",
|
103
|
+
"strand2": "GGTCG"
|
104
|
+
},
|
92
105
|
"expected": 1
|
93
106
|
},
|
94
107
|
{
|
95
108
|
"description": "small distance in long strands",
|
96
109
|
"property": "distance",
|
97
|
-
"
|
98
|
-
|
110
|
+
"input": {
|
111
|
+
"strand1": "ACCAGGG",
|
112
|
+
"strand2": "ACTATGG"
|
113
|
+
},
|
99
114
|
"expected": 2
|
100
115
|
},
|
101
116
|
{
|
102
117
|
"description": "non-unique character in first strand",
|
103
118
|
"property": "distance",
|
104
|
-
"
|
105
|
-
|
119
|
+
"input": {
|
120
|
+
"strand1": "AAG",
|
121
|
+
"strand2": "AAA"
|
122
|
+
},
|
106
123
|
"expected": 1
|
107
124
|
},
|
108
125
|
{
|
109
126
|
"description": "non-unique character in second strand",
|
110
127
|
"property": "distance",
|
111
|
-
"
|
112
|
-
|
128
|
+
"input": {
|
129
|
+
"strand1": "AAA",
|
130
|
+
"strand2": "AAG"
|
131
|
+
},
|
113
132
|
"expected": 1
|
114
133
|
},
|
115
134
|
{
|
116
135
|
"description": "same nucleotides in different positions",
|
117
136
|
"property": "distance",
|
118
|
-
"
|
119
|
-
|
137
|
+
"input": {
|
138
|
+
"strand1": "TAG",
|
139
|
+
"strand2": "GAT"
|
140
|
+
},
|
120
141
|
"expected": 2
|
121
142
|
},
|
122
143
|
{
|
123
144
|
"description": "large distance",
|
124
145
|
"property": "distance",
|
125
|
-
"
|
126
|
-
|
146
|
+
"input": {
|
147
|
+
"strand1": "GATACA",
|
148
|
+
"strand2": "GCATAA"
|
149
|
+
},
|
127
150
|
"expected": 4
|
128
151
|
},
|
129
152
|
{
|
130
153
|
"description": "large distance in off-by-one strand",
|
131
154
|
"property": "distance",
|
132
|
-
"
|
133
|
-
|
155
|
+
"input": {
|
156
|
+
"strand1": "GGACGGATTCTG",
|
157
|
+
"strand2": "AGGACGGATTCT"
|
158
|
+
},
|
134
159
|
"expected": 9
|
135
160
|
},
|
136
161
|
{
|
137
162
|
"description": "disallow first strand longer",
|
138
163
|
"property": "distance",
|
139
|
-
"
|
140
|
-
|
164
|
+
"input": {
|
165
|
+
"strand1": "AATG",
|
166
|
+
"strand2": "AAA"
|
167
|
+
},
|
141
168
|
"expected": {"error": "left and right strands must be of equal length"}
|
142
169
|
},
|
143
170
|
{
|
144
171
|
"description": "disallow second strand longer",
|
145
172
|
"property": "distance",
|
146
|
-
"
|
147
|
-
|
173
|
+
"input": {
|
174
|
+
"strand1": "ATA",
|
175
|
+
"strand2": "AGTG"
|
176
|
+
},
|
148
177
|
"expected": {"error": "left and right strands must be of equal length"}
|
149
178
|
}
|
150
179
|
]
|
151
180
|
}
|
152
|
-
|
153
181
|
=end code
|
@@ -22,17 +22,16 @@ is hello, |.<expected description> for @($c-data<cases>);
|
|
22
22
|
|
23
23
|
=head2 Canonical Data
|
24
24
|
=begin code
|
25
|
-
|
26
25
|
{
|
27
26
|
"exercise": "hello-world",
|
28
|
-
"version": "1.
|
27
|
+
"version": "1.1.0",
|
29
28
|
"cases": [
|
30
29
|
{
|
31
30
|
"description": "Say Hi!",
|
32
31
|
"property": "hello",
|
32
|
+
"input": {},
|
33
33
|
"expected": "Hello, World!"
|
34
34
|
}
|
35
35
|
]
|
36
36
|
}
|
37
|
-
|
38
37
|
=end code
|
@@ -16,7 +16,7 @@ if Leap.^ver !~~ $version {
|
|
16
16
|
|
17
17
|
my $c-data = from-json $=pod.pop.contents;
|
18
18
|
for $c-data<cases>.values {
|
19
|
-
given is-leap-year .<input> -> $result {
|
19
|
+
given is-leap-year .<input><year> -> $result {
|
20
20
|
subtest .<description>, {
|
21
21
|
plan 2;
|
22
22
|
isa-ok $result, Bool;
|
@@ -27,36 +27,42 @@ for $c-data<cases>.values {
|
|
27
27
|
|
28
28
|
=head2 Canonical Data
|
29
29
|
=begin code
|
30
|
-
|
31
30
|
{
|
32
31
|
"exercise": "leap",
|
33
|
-
"version": "1.
|
32
|
+
"version": "1.3.0",
|
34
33
|
"cases": [
|
35
34
|
{
|
36
35
|
"description": "year not divisible by 4: common year",
|
37
36
|
"property": "leapYear",
|
38
|
-
"input":
|
37
|
+
"input": {
|
38
|
+
"year": 2015
|
39
|
+
},
|
39
40
|
"expected": false
|
40
41
|
},
|
41
42
|
{
|
42
43
|
"description": "year divisible by 4, not divisible by 100: leap year",
|
43
44
|
"property": "leapYear",
|
44
|
-
"input":
|
45
|
+
"input": {
|
46
|
+
"year": 1996
|
47
|
+
},
|
45
48
|
"expected": true
|
46
49
|
},
|
47
50
|
{
|
48
51
|
"description": "year divisible by 100, not divisible by 400: common year",
|
49
52
|
"property": "leapYear",
|
50
|
-
"input":
|
53
|
+
"input": {
|
54
|
+
"year": 2100
|
55
|
+
},
|
51
56
|
"expected": false
|
52
57
|
},
|
53
58
|
{
|
54
59
|
"description": "year divisible by 400: leap year",
|
55
60
|
"property": "leapYear",
|
56
|
-
"input":
|
61
|
+
"input": {
|
62
|
+
"year": 2000
|
63
|
+
},
|
57
64
|
"expected": true
|
58
65
|
}
|
59
66
|
]
|
60
67
|
}
|
61
|
-
|
62
68
|
=end code
|
@@ -4,10 +4,10 @@ plan: 5
|
|
4
4
|
tests: |-
|
5
5
|
for $c-data<cases>».<cases>».Array.flat {
|
6
6
|
if .<expected><error> {
|
7
|
-
throws-like {nucleotide-count(.<strand>)}, Exception, .<description>;
|
7
|
+
throws-like {nucleotide-count(.<input><strand>)}, Exception, .<description>;
|
8
8
|
}
|
9
9
|
else {
|
10
|
-
cmp-ok nucleotide-count(.<strand>), '~~', .<expected>.Bag, .<description>;
|
10
|
+
cmp-ok nucleotide-count(.<input><strand>), '~~', .<expected>.Bag, .<description>;
|
11
11
|
}
|
12
12
|
}
|
13
13
|
|
@@ -17,19 +17,18 @@ if NucleotideCount.^ver !~~ $version {
|
|
17
17
|
my $c-data = from-json $=pod.pop.contents;
|
18
18
|
for $c-data<cases>».<cases>».Array.flat {
|
19
19
|
if .<expected><error> {
|
20
|
-
throws-like {nucleotide-count(.<strand>)}, Exception, .<description>;
|
20
|
+
throws-like {nucleotide-count(.<input><strand>)}, Exception, .<description>;
|
21
21
|
}
|
22
22
|
else {
|
23
|
-
cmp-ok nucleotide-count(.<strand>), '~~', .<expected>.Bag, .<description>;
|
23
|
+
cmp-ok nucleotide-count(.<input><strand>), '~~', .<expected>.Bag, .<description>;
|
24
24
|
}
|
25
25
|
}
|
26
26
|
|
27
27
|
=head2 Canonical Data
|
28
28
|
=begin code
|
29
|
-
|
30
29
|
{
|
31
30
|
"exercise": "nucleotide-count",
|
32
|
-
"version": "1.
|
31
|
+
"version": "1.3.0",
|
33
32
|
"cases": [
|
34
33
|
{
|
35
34
|
"description": "count all nucleotides in a strand",
|
@@ -37,7 +36,9 @@ for $c-data<cases>».<cases>».Array.flat {
|
|
37
36
|
{
|
38
37
|
"description": "empty strand",
|
39
38
|
"property": "nucleotideCounts",
|
40
|
-
"
|
39
|
+
"input": {
|
40
|
+
"strand": ""
|
41
|
+
},
|
41
42
|
"expected": {
|
42
43
|
"A": 0,
|
43
44
|
"C": 0,
|
@@ -48,7 +49,9 @@ for $c-data<cases>».<cases>».Array.flat {
|
|
48
49
|
{
|
49
50
|
"description": "can count one nucleotide in single-character input",
|
50
51
|
"property": "nucleotideCounts",
|
51
|
-
"
|
52
|
+
"input": {
|
53
|
+
"strand": "G"
|
54
|
+
},
|
52
55
|
"expected": {
|
53
56
|
"A": 0,
|
54
57
|
"C": 0,
|
@@ -59,7 +62,9 @@ for $c-data<cases>».<cases>».Array.flat {
|
|
59
62
|
{
|
60
63
|
"description": "strand with repeated nucleotide",
|
61
64
|
"property": "nucleotideCounts",
|
62
|
-
"
|
65
|
+
"input": {
|
66
|
+
"strand": "GGGGGGG"
|
67
|
+
},
|
63
68
|
"expected": {
|
64
69
|
"A": 0,
|
65
70
|
"C": 0,
|
@@ -70,7 +75,9 @@ for $c-data<cases>».<cases>».Array.flat {
|
|
70
75
|
{
|
71
76
|
"description": "strand with multiple nucleotides",
|
72
77
|
"property": "nucleotideCounts",
|
73
|
-
"
|
78
|
+
"input": {
|
79
|
+
"strand": "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC"
|
80
|
+
},
|
74
81
|
"expected": {
|
75
82
|
"A": 20,
|
76
83
|
"C": 12,
|
@@ -81,7 +88,9 @@ for $c-data<cases>».<cases>».Array.flat {
|
|
81
88
|
{
|
82
89
|
"description": "strand with invalid nucleotides",
|
83
90
|
"property": "nucleotideCounts",
|
84
|
-
"
|
91
|
+
"input": {
|
92
|
+
"strand": "AGXXACT"
|
93
|
+
},
|
85
94
|
"expected": {
|
86
95
|
"error": "Invalid nucleotide in strand"
|
87
96
|
}
|
@@ -90,5 +99,4 @@ for $c-data<cases>».<cases>».Array.flat {
|
|
90
99
|
}
|
91
100
|
]
|
92
101
|
}
|
93
|
-
|
94
102
|
=end code
|