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
@@ -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.
|
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":
|
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":
|
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":
|
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":
|
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":
|
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":
|
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":
|
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":
|
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":
|
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:
|
3
|
-
plan:
|
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
|
|
@@ -4,9 +4,9 @@ use Test;
|
|
4
4
|
use JSON::Fast;
|
5
5
|
use lib $?FILE.IO.dirname;
|
6
6
|
use Phone;
|
7
|
-
plan
|
7
|
+
plan 14;
|
8
8
|
|
9
|
-
my Version:D $version =
|
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.
|
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
|
-
"
|
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
|
-
"
|
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
|
-
"
|
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
|
-
"
|
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
|
-
"
|
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
|
-
"
|
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
|
-
"
|
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
|
-
"
|
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
|
-
"
|
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
|
-
"
|
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
|
129
|
+
"description": "invalid if area code starts with 1",
|
103
130
|
"property": "clean",
|
104
|
-
"
|
131
|
+
"input": {
|
132
|
+
"phrase": "(123) 456-7890"
|
133
|
+
},
|
105
134
|
"expected": null
|
106
135
|
},
|
107
136
|
{
|
108
|
-
"description": "invalid if exchange code
|
137
|
+
"description": "invalid if exchange code starts with 0",
|
109
138
|
"property": "clean",
|
110
|
-
"
|
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
|
@@ -38,7 +38,7 @@ tests, including any optional tests marked as 'TODO'.
|
|
38
38
|
|
39
39
|
## Source
|
40
40
|
|
41
|
-
|
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.
|
24
|
+
"version": "1.2.0",
|
26
25
|
"cases": [
|
27
26
|
{
|
28
27
|
"description": "RNA complement of cytosine is guanine",
|
29
28
|
"property": "toRna",
|
30
|
-
"
|
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
|
-
"
|
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
|
-
"
|
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
|
-
"
|
53
|
+
"input": {
|
54
|
+
"dna": "A"
|
55
|
+
},
|
49
56
|
"expected": "U"
|
50
57
|
},
|
51
58
|
{
|
52
59
|
"description": "RNA complement",
|
53
60
|
"property": "toRna",
|
54
|
-
"
|
61
|
+
"input": {
|
62
|
+
"dna": "ACGTGGTCTTAA"
|
63
|
+
},
|
55
64
|
"expected": "UGCACCAGAAUU"
|
56
65
|
}
|
57
66
|
]
|
58
67
|
}
|
59
|
-
|
60
68
|
=end code
|