trackler 2.0.8.7 → 2.0.8.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/CONTRIBUTING.md +2 -2
- data/common/exercises/diamond/canonical-data.json +125 -0
- data/common/exercises/difference-of-squares/metadata.yml +1 -1
- data/common/exercises/hello-world/description.md +1 -1
- data/common/exercises/perfect-numbers/canonical-data.json +108 -0
- data/common/exercises/word-search/description.md +9 -9
- data/lib/trackler/version.rb +1 -1
- data/tracks/delphi/exercises/bob/uBobTests.pas +17 -17
- data/tracks/elixir/config.json +6 -0
- data/tracks/elixir/exercises/all-your-base/all-your-base-test.exs +115 -0
- data/tracks/elixir/exercises/all-your-base/all-your-base.exs +10 -0
- data/tracks/elixir/exercises/all-your-base/example.exs +48 -0
- data/tracks/erlang/.gitignore +1 -0
- data/tracks/erlang/.travis.yml +5 -1
- data/tracks/erlang/bin/journey-test.sh +264 -0
- data/tracks/erlang/exercises/allergies/test/allergies_tests.erl +1 -1
- data/tracks/erlang/exercises/nucleotide-count/test/{dna_tests.erl → nucleotide_count_tests.erl} +2 -2
- data/tracks/erlang/exercises/parallel-letter-frequency/src/example.erl +1 -1
- data/tracks/erlang/exercises/phone-number/test/{phone_tests.erl → phone_number_tests.erl} +2 -2
- data/tracks/erlang/exercises/robot-simulator/src/example.erl +1 -1
- data/tracks/erlang/exercises/scrabble-score/test/scrabble_score_tests.erl +1 -1
- data/tracks/erlang/exercises/series/src/example.erl +1 -1
- data/tracks/go/exercises/parallel-letter-frequency/example.go +2 -0
- data/tracks/go/exercises/parallel-letter-frequency/parallel_letter_frequency_test.go +8 -0
- data/tracks/go/exercises/pascals-triangle/example.go +2 -0
- data/tracks/go/exercises/pascals-triangle/pascals_triangle_test.go +8 -0
- data/tracks/java/exercises/acronym/src/test/java/AcronymTest.java +8 -0
- data/tracks/java/exercises/beer-song/src/test/java/BeerSongTest.java +44 -8
- data/tracks/javascript/config.json +27 -9
- data/tracks/julia/README.md +3 -0
- data/tracks/julia/img/logo.png +0 -0
- data/tracks/julia/img/logo.svg +11 -0
- data/tracks/r/exercises/TRACK_HINTS.md +8 -0
- data/tracks/typescript/config.json +1 -1
- metadata +13 -5
- data/tracks/r/docs/SETUP.md +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e62546727fedd95973681d450fffd9b90c5c3ede
|
4
|
+
data.tar.gz: fd0387e4ccf20d919d388471d2f4c26b83f04129
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2429ecbe7c6f1b7b0b9e389ee3ae0e5171057abb43f425fb20d1fb66b5077a9177f2b58d0fd1cbfc0f0d29e2026f511753e59b03b23f734cfaaa598ea92a6cdf
|
7
|
+
data.tar.gz: 7969ad1d115aa1d2a0dd93292009745b7d94b4f5d68e2d349123b6d8abff9743794e6003a4a2823e94e6e8d1d07577d6d668c605c33a78125b60b36438879e41
|
data/common/CONTRIBUTING.md
CHANGED
@@ -290,10 +290,10 @@ here.
|
|
290
290
|
## Porting an Exercise to Another Language Track
|
291
291
|
|
292
292
|
To get a list of all the exercises that can be ported to a track,
|
293
|
-
go to the url `http://exercism.io/languages/:track_id/
|
293
|
+
go to the url `http://exercism.io/languages/:track_id/todo`.
|
294
294
|
|
295
295
|
For example here is the list of exercises that have not yet been implemented
|
296
|
-
for the Ruby track: http://exercism.io/languages/ruby/
|
296
|
+
for the Ruby track: http://exercism.io/languages/ruby/todo
|
297
297
|
|
298
298
|
Each unimplemented exercise links to existing implementations of the exercise in
|
299
299
|
other language tracks, so that people can use those example solutions and test
|
@@ -0,0 +1,125 @@
|
|
1
|
+
{
|
2
|
+
"exercise": "diamond",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"comments": [
|
5
|
+
" The tests contained within this canonical data file are suitable ",
|
6
|
+
" for value-based testing, in which each test case checks that the ",
|
7
|
+
" value returned by the function under test is in every way ",
|
8
|
+
" identical to a given expected value. ",
|
9
|
+
" ",
|
10
|
+
" This exercise is also amenable to property-based testing, in which ",
|
11
|
+
" each test case verifies that the value returned by the function ",
|
12
|
+
" under test exhibits a specific desired property. ",
|
13
|
+
" ",
|
14
|
+
" Several tracks (notably, C# and Go) forgo the value-based tests ",
|
15
|
+
" below in favor of property-based tests. If you are feeling ",
|
16
|
+
" adventurous and would like to use this exercise to introduce the ",
|
17
|
+
" concept of property-based testing to participants in your track, ",
|
18
|
+
" please ignore the value-based tests below and instead reference ",
|
19
|
+
" the test suites in the aforementioned tracks. "
|
20
|
+
],
|
21
|
+
"cases": [
|
22
|
+
{
|
23
|
+
"description": "Degenerate case with a single 'A' row",
|
24
|
+
"property": "rows",
|
25
|
+
"input": "A",
|
26
|
+
"expected": [
|
27
|
+
"A"
|
28
|
+
]
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"description": "Degenerate case with no row containing 3 distinct groups of spaces",
|
32
|
+
"property": "rows",
|
33
|
+
"input": "B",
|
34
|
+
"expected": [
|
35
|
+
" A ",
|
36
|
+
"B B",
|
37
|
+
" A "
|
38
|
+
]
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"description": "Smallest non-degenerate case with odd diamond side length",
|
42
|
+
"property": "rows",
|
43
|
+
"input": "C",
|
44
|
+
"expected": [
|
45
|
+
" A ",
|
46
|
+
" B B ",
|
47
|
+
"C C",
|
48
|
+
" B B ",
|
49
|
+
" A "
|
50
|
+
]
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"description": "Smallest non-degenerate case with even diamond side length",
|
54
|
+
"property": "rows",
|
55
|
+
"input": "D",
|
56
|
+
"expected": [
|
57
|
+
" A ",
|
58
|
+
" B B ",
|
59
|
+
" C C ",
|
60
|
+
"D D",
|
61
|
+
" C C ",
|
62
|
+
" B B ",
|
63
|
+
" A "
|
64
|
+
]
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"description": "Largest possible diamond",
|
68
|
+
"property": "rows",
|
69
|
+
"input": "Z",
|
70
|
+
"expected": [
|
71
|
+
" A ",
|
72
|
+
" B B ",
|
73
|
+
" C C ",
|
74
|
+
" D D ",
|
75
|
+
" E E ",
|
76
|
+
" F F ",
|
77
|
+
" G G ",
|
78
|
+
" H H ",
|
79
|
+
" I I ",
|
80
|
+
" J J ",
|
81
|
+
" K K ",
|
82
|
+
" L L ",
|
83
|
+
" M M ",
|
84
|
+
" N N ",
|
85
|
+
" O O ",
|
86
|
+
" P P ",
|
87
|
+
" Q Q ",
|
88
|
+
" R R ",
|
89
|
+
" S S ",
|
90
|
+
" T T ",
|
91
|
+
" U U ",
|
92
|
+
" V V ",
|
93
|
+
" W W ",
|
94
|
+
" X X ",
|
95
|
+
" Y Y ",
|
96
|
+
"Z Z",
|
97
|
+
" Y Y ",
|
98
|
+
" X X ",
|
99
|
+
" W W ",
|
100
|
+
" V V ",
|
101
|
+
" U U ",
|
102
|
+
" T T ",
|
103
|
+
" S S ",
|
104
|
+
" R R ",
|
105
|
+
" Q Q ",
|
106
|
+
" P P ",
|
107
|
+
" O O ",
|
108
|
+
" N N ",
|
109
|
+
" M M ",
|
110
|
+
" L L ",
|
111
|
+
" K K ",
|
112
|
+
" J J ",
|
113
|
+
" I I ",
|
114
|
+
" H H ",
|
115
|
+
" G G ",
|
116
|
+
" F F ",
|
117
|
+
" E E ",
|
118
|
+
" D D ",
|
119
|
+
" C C ",
|
120
|
+
" B B ",
|
121
|
+
" A "
|
122
|
+
]
|
123
|
+
}
|
124
|
+
]
|
125
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
---
|
2
|
-
blurb: "Find the difference between the
|
2
|
+
blurb: "Find the difference between the square of the sum and the sum of the squares of the first N natural numbers."
|
3
3
|
source: "Problem 6 at Project Euler"
|
4
4
|
source_url: "http://projecteuler.net/problem=6"
|
@@ -4,7 +4,7 @@ or environment.
|
|
4
4
|
|
5
5
|
The objectives are simple:
|
6
6
|
|
7
|
-
- Write a function that
|
7
|
+
- Write a function that returns the string "Hello, World!".
|
8
8
|
- Run the test suite and make sure that it succeeds.
|
9
9
|
- Submit your solution and check it at the website.
|
10
10
|
|
@@ -0,0 +1,108 @@
|
|
1
|
+
{
|
2
|
+
"exercise": "perfect-numbers",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"cases": [
|
5
|
+
{
|
6
|
+
"description": "Perfect numbers",
|
7
|
+
"cases": [
|
8
|
+
{
|
9
|
+
"description": "Smallest perfect number is classified correctly",
|
10
|
+
"property": "classify",
|
11
|
+
"input": 6,
|
12
|
+
"expected": "perfect"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"description": "Medium perfect number is classified correctly",
|
16
|
+
"property": "classify",
|
17
|
+
"input": 28,
|
18
|
+
"expected": "perfect"
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"description": "Large perfect number is classified correctly",
|
22
|
+
"property": "classify",
|
23
|
+
"input": 33550336,
|
24
|
+
"expected": "perfect"
|
25
|
+
}
|
26
|
+
]
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"description": "Abundant numbers",
|
30
|
+
"cases": [
|
31
|
+
{
|
32
|
+
"description": "Smallest abundant number is classified correctly",
|
33
|
+
"property": "classify",
|
34
|
+
"input": 12,
|
35
|
+
"expected": "abundant"
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"description": "Medium abundant number is classified correctly",
|
39
|
+
"property": "classify",
|
40
|
+
"input": 30,
|
41
|
+
"expected": "abundant"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"description": "Large abundant number is classified correctly",
|
45
|
+
"property": "classify",
|
46
|
+
"input": 33550335,
|
47
|
+
"expected": "abundant"
|
48
|
+
}
|
49
|
+
]
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"description": "Deficient numbers",
|
53
|
+
"cases": [
|
54
|
+
{
|
55
|
+
"description": "Smallest prime deficient number is classified correctly",
|
56
|
+
"property": "classify",
|
57
|
+
"input": 2,
|
58
|
+
"expected": "deficient"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"description": "Smallest non-prime deficient number is classified correctly",
|
62
|
+
"property": "classify",
|
63
|
+
"input": 4,
|
64
|
+
"expected": "deficient"
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"description": "Medium deficient number is classified correctly",
|
68
|
+
"property": "classify",
|
69
|
+
"input": 32,
|
70
|
+
"expected": "deficient"
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"description": "Large deficient number is classified correctly",
|
74
|
+
"property": "classify",
|
75
|
+
"input": 33550337,
|
76
|
+
"expected": "deficient"
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"description": "Edge case (no factors other than itself) is classified correctly",
|
80
|
+
"property": "classify",
|
81
|
+
"input": 1,
|
82
|
+
"expected": "deficient"
|
83
|
+
}
|
84
|
+
]
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"description": "Invalid inputs",
|
88
|
+
"cases": [
|
89
|
+
{
|
90
|
+
"description": "Non-negative integer is rejected (not a natural number)",
|
91
|
+
"property": "classify",
|
92
|
+
"input": 0,
|
93
|
+
"expected": {
|
94
|
+
"error": "Classification is only possible for natural numbers."
|
95
|
+
}
|
96
|
+
},
|
97
|
+
{
|
98
|
+
"description": "Negative integer is rejected (not a natural number)",
|
99
|
+
"property": "classify",
|
100
|
+
"input": -1,
|
101
|
+
"expected": {
|
102
|
+
"error": "Classification is only possible for natural numbers."
|
103
|
+
}
|
104
|
+
}
|
105
|
+
]
|
106
|
+
}
|
107
|
+
]
|
108
|
+
}
|
@@ -4,15 +4,15 @@ words in them.
|
|
4
4
|
For example:
|
5
5
|
|
6
6
|
```
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
jefblpepre
|
8
|
+
camdcimgtc
|
9
|
+
oivokprjsm
|
10
|
+
pbwasqroua
|
11
|
+
rixilelhrs
|
12
|
+
wolcqlirpc
|
13
|
+
screeaumgr
|
14
|
+
alxhpburyi
|
15
|
+
jalaycalmp
|
16
16
|
clojurermt
|
17
17
|
```
|
18
18
|
|
data/lib/trackler/version.rb
CHANGED
@@ -13,71 +13,71 @@ type
|
|
13
13
|
procedure Stating_something;
|
14
14
|
|
15
15
|
[Test]
|
16
|
-
[Ignore]
|
16
|
+
[Ignore('Comment this line to run this test')]
|
17
17
|
procedure Shouting;
|
18
18
|
|
19
19
|
[Test]
|
20
|
-
[Ignore]
|
20
|
+
[Ignore('Comment this line to run this test')]
|
21
21
|
procedure Asking_a_question;
|
22
22
|
|
23
23
|
[Test]
|
24
|
-
[Ignore]
|
24
|
+
[Ignore('Comment this line to run this test')]
|
25
25
|
procedure Asking_a_question_with_a_trailing_space;
|
26
26
|
|
27
27
|
[Test]
|
28
|
-
[Ignore]
|
28
|
+
[Ignore('Comment this line to run this test')]
|
29
29
|
procedure Asking_a_numeric_question;
|
30
30
|
|
31
31
|
[Test]
|
32
|
-
[Ignore]
|
32
|
+
[Ignore('Comment this line to run this test')]
|
33
33
|
procedure Talking_forcefully;
|
34
34
|
|
35
35
|
[Test]
|
36
|
-
[Ignore]
|
36
|
+
[Ignore('Comment this line to run this test')]
|
37
37
|
procedure Using_acronyms_in_regular_search;
|
38
38
|
|
39
39
|
[Test]
|
40
|
-
[Ignore]
|
40
|
+
[Ignore('Comment this line to run this test')]
|
41
41
|
procedure Forceful_questions;
|
42
42
|
|
43
43
|
[Test]
|
44
|
-
[Ignore]
|
44
|
+
[Ignore('Comment this line to run this test')]
|
45
45
|
procedure Shouting_numbers;
|
46
46
|
|
47
47
|
[Test]
|
48
|
-
[Ignore]
|
48
|
+
[Ignore('Comment this line to run this test')]
|
49
49
|
procedure Only_numbers;
|
50
50
|
|
51
51
|
[Test]
|
52
|
-
[Ignore]
|
52
|
+
[Ignore('Comment this line to run this test')]
|
53
53
|
procedure Question_with_only_numbers;
|
54
54
|
|
55
55
|
[Test]
|
56
|
-
[Ignore]
|
56
|
+
[Ignore('Comment this line to run this test')]
|
57
57
|
procedure Shouting_with_special_characters;
|
58
58
|
|
59
59
|
[Test]
|
60
|
-
[Ignore]
|
60
|
+
[Ignore('Comment this line to run this test')]
|
61
61
|
procedure Shouting_with_no_exclamation_mark;
|
62
62
|
|
63
63
|
[Test]
|
64
|
-
[Ignore]
|
64
|
+
[Ignore('Comment this line to run this test')]
|
65
65
|
procedure Statement_containing_question_mark;
|
66
66
|
|
67
67
|
[Test]
|
68
|
-
[Ignore]
|
68
|
+
[Ignore('Comment this line to run this test')]
|
69
69
|
procedure Prattling_on;
|
70
70
|
|
71
71
|
[Test]
|
72
|
-
[Ignore]
|
72
|
+
[Ignore('Comment this line to run this test')]
|
73
73
|
procedure Silence;
|
74
74
|
|
75
75
|
[Test]
|
76
|
-
[Ignore]
|
76
|
+
[Ignore('Comment this line to run this test')]
|
77
77
|
procedure Prolonged_silence;
|
78
78
|
|
79
79
|
[Test]
|
80
|
-
[Ignore]
|
80
|
+
[Ignore('Comment this line to run this test')]
|
81
81
|
procedure Multiple_line_question;
|
82
82
|
end;
|
83
83
|
|
data/tracks/elixir/config.json
CHANGED
@@ -0,0 +1,115 @@
|
|
1
|
+
if !System.get_env("EXERCISM_TEST_EXAMPLES") do
|
2
|
+
Code.load_file("example.exs", __DIR__)
|
3
|
+
end
|
4
|
+
|
5
|
+
ExUnit.start
|
6
|
+
ExUnit.configure exclude: :pending, trace: true
|
7
|
+
|
8
|
+
defmodule AllYourBaseTest do
|
9
|
+
use ExUnit.Case
|
10
|
+
|
11
|
+
test "convert single bit one to decimal" do
|
12
|
+
assert AllYourBase.convert([1], 2, 10) == [1]
|
13
|
+
end
|
14
|
+
|
15
|
+
@tag :pending
|
16
|
+
test "convert binary to single decimal" do
|
17
|
+
assert AllYourBase.convert([1, 0, 1], 2, 10) == [5]
|
18
|
+
end
|
19
|
+
|
20
|
+
@tag :pending
|
21
|
+
test "convert single decimal to binary" do
|
22
|
+
assert AllYourBase.convert([5], 10, 2) == [1, 0, 1]
|
23
|
+
end
|
24
|
+
|
25
|
+
@tag :pending
|
26
|
+
test "convert binary to multiple decimal" do
|
27
|
+
assert AllYourBase.convert([1, 0, 1, 0, 1, 0], 2, 10) == [4, 2]
|
28
|
+
end
|
29
|
+
|
30
|
+
@tag :pending
|
31
|
+
test "convert decimal to binary" do
|
32
|
+
assert AllYourBase.convert([4, 2], 10, 2) == [1, 0, 1, 0, 1, 0]
|
33
|
+
end
|
34
|
+
|
35
|
+
@tag :pending
|
36
|
+
test "convert trinary to hexadecimal" do
|
37
|
+
assert AllYourBase.convert([1, 1, 2, 0], 3, 16) == [2, 10]
|
38
|
+
end
|
39
|
+
|
40
|
+
@tag :pending
|
41
|
+
test "convert hexadecimal to trinary" do
|
42
|
+
assert AllYourBase.convert([2, 10], 16, 3) == [1, 1, 2, 0]
|
43
|
+
end
|
44
|
+
|
45
|
+
@tag :pending
|
46
|
+
test "convert 15-bit integer" do
|
47
|
+
assert AllYourBase.convert([3, 46, 60], 97, 73) == [6, 10, 45]
|
48
|
+
end
|
49
|
+
|
50
|
+
@tag :pending
|
51
|
+
test "convert empty list" do
|
52
|
+
assert AllYourBase.convert([], 2, 10) == nil
|
53
|
+
end
|
54
|
+
|
55
|
+
@tag :pending
|
56
|
+
test "convert single zero" do
|
57
|
+
assert AllYourBase.convert([0], 10, 2) == [0]
|
58
|
+
end
|
59
|
+
|
60
|
+
@tag :pending
|
61
|
+
test "convert multiple zeros" do
|
62
|
+
assert AllYourBase.convert([0, 0, 0], 10, 2) == [0]
|
63
|
+
end
|
64
|
+
|
65
|
+
@tag :pending
|
66
|
+
test "convert leading zeros" do
|
67
|
+
assert AllYourBase.convert([0, 6, 0], 7, 10) == [4, 2]
|
68
|
+
end
|
69
|
+
|
70
|
+
@tag :pending
|
71
|
+
test "convert negative digit" do
|
72
|
+
assert AllYourBase.convert([1, -1, 1, 0, 1, 0], 2, 10) == nil
|
73
|
+
end
|
74
|
+
|
75
|
+
@tag :pending
|
76
|
+
test "convert invalid positive digit" do
|
77
|
+
assert AllYourBase.convert([1, 2, 1, 0, 1, 0], 2, 10) == nil
|
78
|
+
end
|
79
|
+
|
80
|
+
@tag :pending
|
81
|
+
test "convert first base is one" do
|
82
|
+
assert AllYourBase.convert([], 1, 10) == nil
|
83
|
+
end
|
84
|
+
|
85
|
+
@tag :pending
|
86
|
+
test "convert second base is one" do
|
87
|
+
assert AllYourBase.convert([1, 0, 1, 0, 1, 0], 2, 1) == nil
|
88
|
+
end
|
89
|
+
|
90
|
+
@tag :pending
|
91
|
+
test "convert first base is zero" do
|
92
|
+
assert AllYourBase.convert([], 0, 10) == nil
|
93
|
+
end
|
94
|
+
|
95
|
+
@tag :pending
|
96
|
+
test "convert second base is zero" do
|
97
|
+
assert AllYourBase.convert([7], 10, 0) == nil
|
98
|
+
end
|
99
|
+
|
100
|
+
@tag :pending
|
101
|
+
test "convert first base is negative" do
|
102
|
+
assert AllYourBase.convert([1], -2, 10) == nil
|
103
|
+
end
|
104
|
+
|
105
|
+
@tag :pending
|
106
|
+
test "convert second base is negative" do
|
107
|
+
assert AllYourBase.convert([1], 2, -7) == nil
|
108
|
+
end
|
109
|
+
|
110
|
+
@tag :pending
|
111
|
+
test "convert both bases are negative" do
|
112
|
+
assert AllYourBase.convert([1], -2, -7) == nil
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|