trackler 2.0.6.36 → 2.0.6.37
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/tracks/fsharp/exercises/isogram/IsogramTest.fs +70 -12
- data/tracks/fsharp/exercises/luhn/LuhnTest.fs +103 -9
- data/tracks/fsharp/exercises/nth-prime/NthPrimeTest.fs +53 -14
- data/tracks/go/config.json +5 -0
- data/tracks/go/exercises/forth/cases_test.go +246 -0
- data/tracks/go/exercises/forth/example.go +238 -0
- data/tracks/go/exercises/forth/example_gen.go +99 -0
- data/tracks/go/exercises/forth/forth_test.go +64 -0
- data/tracks/java/exercises/phone-number/src/example/java/PhoneNumber.java +19 -25
- data/tracks/java/exercises/phone-number/src/test/java/PhoneNumberTest.java +44 -30
- data/tracks/ocaml/README.md +11 -0
- data/tracks/ocaml/tools/test-generator/README.md +39 -1
- data/tracks/perl6/.travis.yml +1 -1
- data/tracks/perl6/exercises/allergies/allergies.t +118 -3
- data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +91 -3
- data/tracks/perl6/exercises/phone-number/phone-number.t +58 -5
- data/tracks/perl6/exercises/space-age/space-age.t +51 -4
- data/tracks/perl6/exercises/wordy/wordy.t +91 -4
- metadata +6 -7
- data/tracks/perl6/exercises/allergies/cases.json +0 -109
- data/tracks/perl6/exercises/atbash-cipher/cases.json +0 -82
- data/tracks/perl6/exercises/phone-number/cases.json +0 -47
- data/tracks/perl6/exercises/space-age/cases.json +0 -46
- data/tracks/perl6/exercises/wordy/cases.json +0 -89
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0851a1075b06ef0bcf3a59ba9ffa6072f1df8b44
|
4
|
+
data.tar.gz: f890063e05af38c4a48d0d0fd1d9c8e2632418d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6462d9ecac9f0af0664b798ee4dc9b65f0da97eeac0d8cf4a64e854a381909931cd150dd7605d1b80091ef249656e05598e32eed9f45bfdad7ac80d8bf90717
|
7
|
+
data.tar.gz: bf00c473405dfb45099e1d259a1687cd93f0f9d01eb473e62d292ef8bb2c3068a3a744a92bedb759d42ae21db2822632ad4b5053bccdf6de72828f8aa3b842a2
|
data/lib/trackler/version.rb
CHANGED
@@ -4,15 +4,73 @@ open NUnit.Framework
|
|
4
4
|
|
5
5
|
open Isogram
|
6
6
|
|
7
|
-
[<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
[<
|
15
|
-
[<
|
16
|
-
|
17
|
-
let
|
18
|
-
|
7
|
+
[<Test>]
|
8
|
+
let ``Empty string`` () =
|
9
|
+
let input = ""
|
10
|
+
let expected = true
|
11
|
+
let actual = isogram input
|
12
|
+
Assert.That(actual, Is.EqualTo(expected))
|
13
|
+
|
14
|
+
[<Test>]
|
15
|
+
[<Ignore("Remove to run test")>]
|
16
|
+
let ``Isogram with only lower case characters`` () =
|
17
|
+
let input = "isogram"
|
18
|
+
let expected = true
|
19
|
+
let actual = isogram input
|
20
|
+
Assert.That(actual, Is.EqualTo(expected))
|
21
|
+
|
22
|
+
[<Test>]
|
23
|
+
[<Ignore("Remove to run test")>]
|
24
|
+
let ``Word with one duplicated character`` () =
|
25
|
+
let input = "eleven"
|
26
|
+
let expected = false
|
27
|
+
let actual = isogram input
|
28
|
+
Assert.That(actual, Is.EqualTo(expected))
|
29
|
+
|
30
|
+
[<Test>]
|
31
|
+
[<Ignore("Remove to run test")>]
|
32
|
+
let ``Longest reported english isogram`` () =
|
33
|
+
let input = "subdermatoglyphic"
|
34
|
+
let expected = true
|
35
|
+
let actual = isogram input
|
36
|
+
Assert.That(actual, Is.EqualTo(expected))
|
37
|
+
|
38
|
+
[<Test>]
|
39
|
+
[<Ignore("Remove to run test")>]
|
40
|
+
let ``Word with duplicated character in mixed case`` () =
|
41
|
+
let input = "Alphabet"
|
42
|
+
let expected = false
|
43
|
+
let actual = isogram input
|
44
|
+
Assert.That(actual, Is.EqualTo(expected))
|
45
|
+
|
46
|
+
[<Test>]
|
47
|
+
[<Ignore("Remove to run test")>]
|
48
|
+
let ``Hypothetical isogrammic word with hyphen`` () =
|
49
|
+
let input = "thumbscrew-japingly"
|
50
|
+
let expected = true
|
51
|
+
let actual = isogram input
|
52
|
+
Assert.That(actual, Is.EqualTo(expected))
|
53
|
+
|
54
|
+
[<Test>]
|
55
|
+
[<Ignore("Remove to run test")>]
|
56
|
+
let ``Isogram with duplicated non letter character`` () =
|
57
|
+
let input = "Hjelmqvist-Gryb-Zock-Pfund-Wax"
|
58
|
+
let expected = true
|
59
|
+
let actual = isogram input
|
60
|
+
Assert.That(actual, Is.EqualTo(expected))
|
61
|
+
|
62
|
+
[<Test>]
|
63
|
+
[<Ignore("Remove to run test")>]
|
64
|
+
let ``Made-up name that is an isogram`` () =
|
65
|
+
let input = "Emily Jung Schwartzkopf"
|
66
|
+
let expected = true
|
67
|
+
let actual = isogram input
|
68
|
+
Assert.That(actual, Is.EqualTo(expected))
|
69
|
+
|
70
|
+
[<Test>]
|
71
|
+
[<Ignore("Remove to run test")>]
|
72
|
+
let ``Word with duplicated accented character`` () =
|
73
|
+
let input = "éléphant"
|
74
|
+
let expected = false
|
75
|
+
let actual = isogram input
|
76
|
+
Assert.That(actual, Is.EqualTo(expected))
|
@@ -2,12 +2,106 @@ module LuhnTest
|
|
2
2
|
|
3
3
|
open NUnit.Framework
|
4
4
|
open Luhn
|
5
|
-
|
6
|
-
[<
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
|
6
|
+
[<Test>]
|
7
|
+
let ``Single digit strings cannot be valid`` () =
|
8
|
+
let input = "1"
|
9
|
+
let expected = false
|
10
|
+
let actual = valid input
|
11
|
+
Assert.That(actual, Is.EqualTo(expected))
|
12
|
+
|
13
|
+
[<Test>]
|
14
|
+
[<Ignore("Remove to run test")>]
|
15
|
+
let ``A single zero is invalid`` () =
|
16
|
+
let input = "0"
|
17
|
+
let expected = false
|
18
|
+
let actual = valid input
|
19
|
+
Assert.That(actual, Is.EqualTo(expected))
|
20
|
+
|
21
|
+
[<Test>]
|
22
|
+
[<Ignore("Remove to run test")>]
|
23
|
+
let ``Single zero with space is invalid`` () =
|
24
|
+
let input = "0 "
|
25
|
+
let expected = false
|
26
|
+
let actual = valid input
|
27
|
+
Assert.That(actual, Is.EqualTo(expected))
|
28
|
+
|
29
|
+
[<Test>]
|
30
|
+
[<Ignore("Remove to run test")>]
|
31
|
+
let ``Lots of zeros are valid`` () =
|
32
|
+
let input = "00000"
|
33
|
+
let expected = true
|
34
|
+
let actual = valid input
|
35
|
+
Assert.That(actual, Is.EqualTo(expected))
|
36
|
+
|
37
|
+
[<Test>]
|
38
|
+
[<Ignore("Remove to run test")>]
|
39
|
+
let ``Nine doubled is nine`` () =
|
40
|
+
let input = "091"
|
41
|
+
let expected = true
|
42
|
+
let actual = valid input
|
43
|
+
Assert.That(actual, Is.EqualTo(expected))
|
44
|
+
|
45
|
+
[<Test>]
|
46
|
+
[<Ignore("Remove to run test")>]
|
47
|
+
let ``Simple valid number`` () =
|
48
|
+
let input = " 5 9 "
|
49
|
+
let expected = true
|
50
|
+
let actual = valid input
|
51
|
+
Assert.That(actual, Is.EqualTo(expected))
|
52
|
+
|
53
|
+
[<Test>]
|
54
|
+
[<Ignore("Remove to run test")>]
|
55
|
+
let ``Valid Canadian SIN`` () =
|
56
|
+
let input = "046 454 286"
|
57
|
+
let expected = true
|
58
|
+
let actual = valid input
|
59
|
+
Assert.That(actual, Is.EqualTo(expected))
|
60
|
+
|
61
|
+
[<Test>]
|
62
|
+
[<Ignore("Remove to run test")>]
|
63
|
+
let ``Another valid SIN`` () =
|
64
|
+
let input = "055 444 285"
|
65
|
+
let expected = true
|
66
|
+
let actual = valid input
|
67
|
+
Assert.That(actual, Is.EqualTo(expected))
|
68
|
+
|
69
|
+
[<Test>]
|
70
|
+
[<Ignore("Remove to run test")>]
|
71
|
+
let ``Invalid Canadian SIN`` () =
|
72
|
+
let input = "046 454 287"
|
73
|
+
let expected = false
|
74
|
+
let actual = valid input
|
75
|
+
Assert.That(actual, Is.EqualTo(expected))
|
76
|
+
|
77
|
+
[<Test>]
|
78
|
+
[<Ignore("Remove to run test")>]
|
79
|
+
let ``Invalid credit card`` () =
|
80
|
+
let input = "8273 1232 7352 0569"
|
81
|
+
let expected = false
|
82
|
+
let actual = valid input
|
83
|
+
Assert.That(actual, Is.EqualTo(expected))
|
84
|
+
|
85
|
+
[<Test>]
|
86
|
+
[<Ignore("Remove to run test")>]
|
87
|
+
let ``Strings that contain non-digits are not valid`` () =
|
88
|
+
let input = "827a 1232 7352 0569"
|
89
|
+
let expected = false
|
90
|
+
let actual = valid input
|
91
|
+
Assert.That(actual, Is.EqualTo(expected))
|
92
|
+
|
93
|
+
[<Test>]
|
94
|
+
[<Ignore("Remove to run test")>]
|
95
|
+
let ``Punctuation is not allowed`` () =
|
96
|
+
let input = "055-444-285"
|
97
|
+
let expected = false
|
98
|
+
let actual = valid input
|
99
|
+
Assert.That(actual, Is.EqualTo(expected))
|
100
|
+
|
101
|
+
[<Test>]
|
102
|
+
[<Ignore("Remove to run test")>]
|
103
|
+
let ``Symbols are not allowed`` () =
|
104
|
+
let input = "055£ 444$ 285"
|
105
|
+
let expected = false
|
106
|
+
let actual = valid input
|
107
|
+
Assert.That(actual, Is.EqualTo(expected))
|
@@ -1,19 +1,58 @@
|
|
1
1
|
module NthPrimeTest
|
2
2
|
|
3
3
|
open NUnit.Framework
|
4
|
-
|
5
4
|
open NthPrime
|
6
5
|
|
7
|
-
[<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
[<
|
12
|
-
[<
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
[<
|
17
|
-
[<
|
18
|
-
let ``
|
19
|
-
nthPrime
|
6
|
+
[<Test>]
|
7
|
+
let ``First prime`` () =
|
8
|
+
Assert.That(nthPrime 1, Is.EqualTo(2))
|
9
|
+
|
10
|
+
[<Test>]
|
11
|
+
[<Ignore("Remove to run test")>]
|
12
|
+
let ``Second prime`` () =
|
13
|
+
Assert.That(nthPrime 2, Is.EqualTo(3))
|
14
|
+
|
15
|
+
[<Test>]
|
16
|
+
[<Ignore("Remove to run test")>]
|
17
|
+
let ``Third prime`` () =
|
18
|
+
Assert.That(nthPrime 3, Is.EqualTo(5))
|
19
|
+
|
20
|
+
[<Test>]
|
21
|
+
[<Ignore("Remove to run test")>]
|
22
|
+
let ``4th prime`` () =
|
23
|
+
Assert.That(nthPrime 4, Is.EqualTo(7))
|
24
|
+
|
25
|
+
[<Test>]
|
26
|
+
[<Ignore("Remove to run test")>]
|
27
|
+
let ``5th prime`` () =
|
28
|
+
Assert.That(nthPrime 5, Is.EqualTo(11))
|
29
|
+
|
30
|
+
[<Test>]
|
31
|
+
[<Ignore("Remove to run test")>]
|
32
|
+
let ``6th prime`` () =
|
33
|
+
Assert.That(nthPrime 6, Is.EqualTo(13))
|
34
|
+
|
35
|
+
[<Test>]
|
36
|
+
[<Ignore("Remove to run test")>]
|
37
|
+
let ``7th prime`` () =
|
38
|
+
Assert.That(nthPrime 7, Is.EqualTo(17))
|
39
|
+
|
40
|
+
[<Test>]
|
41
|
+
[<Ignore("Remove to run test")>]
|
42
|
+
let ``8th prime`` () =
|
43
|
+
Assert.That(nthPrime 8, Is.EqualTo(19))
|
44
|
+
|
45
|
+
[<Test>]
|
46
|
+
[<Ignore("Remove to run test")>]
|
47
|
+
let ``1000th prime`` () =
|
48
|
+
Assert.That(nthPrime 1000, Is.EqualTo(7919))
|
49
|
+
|
50
|
+
[<Test>]
|
51
|
+
[<Ignore("Remove to run test")>]
|
52
|
+
let ``10000th prime`` () =
|
53
|
+
Assert.That(nthPrime 10000, Is.EqualTo(104729))
|
54
|
+
|
55
|
+
[<Test>]
|
56
|
+
[<Ignore("Remove to run test")>]
|
57
|
+
let ``10001th prime`` () =
|
58
|
+
Assert.That(nthPrime 10001, Is.EqualTo(104743))
|
data/tracks/go/config.json
CHANGED
@@ -0,0 +1,246 @@
|
|
1
|
+
package forth
|
2
|
+
|
3
|
+
// Source: exercism/x-common
|
4
|
+
// Commit: 8804a76 Remove non-ASCII characters tests from forth exercise
|
5
|
+
|
6
|
+
var parsingGroup = []testCase{
|
7
|
+
{
|
8
|
+
"empty input results in empty stack",
|
9
|
+
[]string{},
|
10
|
+
[]int{},
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"numbers just get pushed onto the stack",
|
14
|
+
[]string{"1 2 3 4 5"},
|
15
|
+
[]int{1, 2, 3, 4, 5},
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"all non-word characters are separators",
|
19
|
+
[]string{"1\x002\x133\n4\r5 6\t7"},
|
20
|
+
[]int{1, 2, 3, 4, 5, 6, 7},
|
21
|
+
},
|
22
|
+
}
|
23
|
+
|
24
|
+
var additionGroup = []testCase{
|
25
|
+
{
|
26
|
+
"can add two numbers",
|
27
|
+
[]string{"1 2 +"},
|
28
|
+
[]int{3},
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"errors if there is nothing on the stack",
|
32
|
+
[]string{"+"},
|
33
|
+
[]int(nil),
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"errors if there is only one value on the stack",
|
37
|
+
[]string{"1 +"},
|
38
|
+
[]int(nil),
|
39
|
+
},
|
40
|
+
}
|
41
|
+
|
42
|
+
var subtractionGroup = []testCase{
|
43
|
+
{
|
44
|
+
"can subtract two numbers",
|
45
|
+
[]string{"3 4 -"},
|
46
|
+
[]int{-1},
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"errors if there is nothing on the stack",
|
50
|
+
[]string{"-"},
|
51
|
+
[]int(nil),
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"errors if there is only one value on the stack",
|
55
|
+
[]string{"1 -"},
|
56
|
+
[]int(nil),
|
57
|
+
},
|
58
|
+
}
|
59
|
+
|
60
|
+
var multiplicationGroup = []testCase{
|
61
|
+
{
|
62
|
+
"can multiply two numbers",
|
63
|
+
[]string{"2 4 *"},
|
64
|
+
[]int{8},
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"errors if there is nothing on the stack",
|
68
|
+
[]string{"*"},
|
69
|
+
[]int(nil),
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"errors if there is only one value on the stack",
|
73
|
+
[]string{"1 *"},
|
74
|
+
[]int(nil),
|
75
|
+
},
|
76
|
+
}
|
77
|
+
|
78
|
+
var divisionGroup = []testCase{
|
79
|
+
{
|
80
|
+
"can divide two numbers",
|
81
|
+
[]string{"12 3 /"},
|
82
|
+
[]int{4},
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"performs integer division",
|
86
|
+
[]string{"8 3 /"},
|
87
|
+
[]int{2},
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"errors if dividing by zero",
|
91
|
+
[]string{"4 0 /"},
|
92
|
+
[]int(nil),
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"errors if there is nothing on the stack",
|
96
|
+
[]string{"/"},
|
97
|
+
[]int(nil),
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"errors if there is only one value on the stack",
|
101
|
+
[]string{"1 /"},
|
102
|
+
[]int(nil),
|
103
|
+
},
|
104
|
+
}
|
105
|
+
|
106
|
+
var arithmeticGroup = []testCase{
|
107
|
+
{
|
108
|
+
"addition and subtraction",
|
109
|
+
[]string{"1 2 + 4 -"},
|
110
|
+
[]int{-1},
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"multiplication and division",
|
114
|
+
[]string{"2 4 * 3 /"},
|
115
|
+
[]int{2},
|
116
|
+
},
|
117
|
+
}
|
118
|
+
|
119
|
+
var dupGroup = []testCase{
|
120
|
+
{
|
121
|
+
"copies the top value on the stack",
|
122
|
+
[]string{"1 DUP"},
|
123
|
+
[]int{1, 1},
|
124
|
+
},
|
125
|
+
{
|
126
|
+
"is case-insensitive",
|
127
|
+
[]string{"1 2 Dup"},
|
128
|
+
[]int{1, 2, 2},
|
129
|
+
},
|
130
|
+
{
|
131
|
+
"errors if there is nothing on the stack",
|
132
|
+
[]string{"dup"},
|
133
|
+
[]int(nil),
|
134
|
+
},
|
135
|
+
}
|
136
|
+
|
137
|
+
var dropGroup = []testCase{
|
138
|
+
{
|
139
|
+
"removes the top value on the stack if it is the only one",
|
140
|
+
[]string{"1 drop"},
|
141
|
+
[]int{},
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"removes the top value on the stack if it is not the only one",
|
145
|
+
[]string{"1 2 drop"},
|
146
|
+
[]int{1},
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"errors if there is nothing on the stack",
|
150
|
+
[]string{"drop"},
|
151
|
+
[]int(nil),
|
152
|
+
},
|
153
|
+
}
|
154
|
+
|
155
|
+
var swapGroup = []testCase{
|
156
|
+
{
|
157
|
+
"swaps the top two values on the stack if they are the only ones",
|
158
|
+
[]string{"1 2 swap"},
|
159
|
+
[]int{2, 1},
|
160
|
+
},
|
161
|
+
{
|
162
|
+
"swaps the top two values on the stack if they are not the only ones",
|
163
|
+
[]string{"1 2 3 swap"},
|
164
|
+
[]int{1, 3, 2},
|
165
|
+
},
|
166
|
+
{
|
167
|
+
"errors if there is nothing on the stack",
|
168
|
+
[]string{"swap"},
|
169
|
+
[]int(nil),
|
170
|
+
},
|
171
|
+
{
|
172
|
+
"errors if there is only one value on the stack",
|
173
|
+
[]string{"1 swap"},
|
174
|
+
[]int(nil),
|
175
|
+
},
|
176
|
+
}
|
177
|
+
|
178
|
+
var overGroup = []testCase{
|
179
|
+
{
|
180
|
+
"copies the second element if there are only two",
|
181
|
+
[]string{"1 2 over"},
|
182
|
+
[]int{1, 2, 1},
|
183
|
+
},
|
184
|
+
{
|
185
|
+
"copies the second element if there are more than two",
|
186
|
+
[]string{"1 2 3 over"},
|
187
|
+
[]int{1, 2, 3, 2},
|
188
|
+
},
|
189
|
+
{
|
190
|
+
"errors if there is nothing on the stack",
|
191
|
+
[]string{"over"},
|
192
|
+
[]int(nil),
|
193
|
+
},
|
194
|
+
{
|
195
|
+
"errors if there is only one value on the stack",
|
196
|
+
[]string{"1 over"},
|
197
|
+
[]int(nil),
|
198
|
+
},
|
199
|
+
}
|
200
|
+
|
201
|
+
var userdefinedGroup = []testCase{
|
202
|
+
{
|
203
|
+
"can consist of built-in words",
|
204
|
+
[]string{": dup-twice dup dup ;", "1 dup-twice"},
|
205
|
+
[]int{1, 1, 1},
|
206
|
+
},
|
207
|
+
{
|
208
|
+
"execute in the right order",
|
209
|
+
[]string{": countup 1 2 3 ;", "countup"},
|
210
|
+
[]int{1, 2, 3},
|
211
|
+
},
|
212
|
+
{
|
213
|
+
"can override other user-defined words",
|
214
|
+
[]string{": foo dup ;", ": foo dup dup ;", "1 foo"},
|
215
|
+
[]int{1, 1, 1},
|
216
|
+
},
|
217
|
+
{
|
218
|
+
"can override built-in words",
|
219
|
+
[]string{": swap dup ;", "1 swap"},
|
220
|
+
[]int{1, 1},
|
221
|
+
},
|
222
|
+
{
|
223
|
+
"cannot redefine numbers",
|
224
|
+
[]string{": 1 2 ;"},
|
225
|
+
[]int(nil),
|
226
|
+
},
|
227
|
+
{
|
228
|
+
"errors if executing a non-existent word",
|
229
|
+
[]string{"foo"},
|
230
|
+
[]int(nil),
|
231
|
+
},
|
232
|
+
}
|
233
|
+
|
234
|
+
var testSections = []testcaseSection{
|
235
|
+
{"parsing", parsingGroup},
|
236
|
+
{"addition(+)", additionGroup},
|
237
|
+
{"subtraction(-)", subtractionGroup},
|
238
|
+
{"multiplication(*)", multiplicationGroup},
|
239
|
+
{"division(/)", divisionGroup},
|
240
|
+
{"arithmetic", arithmeticGroup},
|
241
|
+
{"dup", dupGroup},
|
242
|
+
{"drop", dropGroup},
|
243
|
+
{"swap", swapGroup},
|
244
|
+
{"over", overGroup},
|
245
|
+
{"user-defined", userdefinedGroup},
|
246
|
+
}
|