trackler 2.0.6.40 → 2.0.6.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/exercises/book-store/canonical-data.json +7 -1
- data/common/exercises/rotational-cipher/{cannonical-data.json → canonical-data.json} +0 -0
- data/lib/trackler/version.rb +1 -1
- data/tracks/c/config.json +9 -0
- data/tracks/c/exercises/triangle/makefile +16 -0
- data/tracks/c/exercises/triangle/src/example.c +33 -0
- data/tracks/c/exercises/triangle/src/example.h +15 -0
- data/tracks/c/exercises/triangle/src/triangle.h +10 -0
- data/tracks/c/exercises/triangle/test/test_triangle.c +121 -0
- data/tracks/c/exercises/triangle/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/triangle/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/triangle/test/vendor/unity_internals.h +701 -0
- data/tracks/clojure/.gitignore +1 -0
- data/tracks/clojure/_src/clock_generator.clj +5 -0
- data/tracks/clojure/_src/generator.clj +72 -0
- data/tracks/clojure/config.json +6 -0
- data/tracks/clojure/exercises/clock/clock.mustache +34 -0
- data/tracks/clojure/exercises/clock/project.clj +4 -0
- data/tracks/clojure/exercises/clock/src/example.clj +19 -0
- data/tracks/clojure/exercises/clock/test/clock_test.clj +177 -0
- data/tracks/clojure/project.clj +4 -1
- data/tracks/csharp/exercises/poker/Example.cs +1 -1
- data/tracks/csharp/exercises/poker/PokerTest.cs +10 -0
- data/tracks/erlang/docs/INSTALLATION.md +14 -3
- data/tracks/erlang/docs/LEARNING.md +1 -0
- data/tracks/go/exercises/gigasecond/gigasecond_test.go +5 -2
- data/tracks/go/exercises/grade-school/example.go +2 -0
- data/tracks/go/exercises/grade-school/grade_school_test.go +8 -0
- data/tracks/go/exercises/hamming/hamming_test.go +1 -1
- data/tracks/go/exercises/hello-world/hello_test.go +6 -4
- data/tracks/haskell/exercises/accumulate/src/Accumulate.hs +1 -1
- data/tracks/haskell/exercises/anagram/src/Anagram.hs +1 -1
- data/tracks/java/bin/journey-test.sh +21 -4
- data/tracks/java/exercises/allergies/src/example/java/Allergen.java +20 -0
- data/tracks/java/exercises/hamming/src/test/java/HammingTest.java +10 -3
- data/tracks/java/exercises/luhn/src/example/java/LuhnValidator.java +19 -11
- data/tracks/java/exercises/luhn/src/test/java/LuhnValidatorTest.java +43 -1
- data/tracks/java/exercises/meetup/src/example/java/MeetupSchedule.java +8 -0
- data/tracks/java/exercises/meetup/src/test/java/MeetupTest.java +91 -91
- data/tracks/java/exercises/perfect-numbers/src/example/java/Classification.java +5 -0
- data/tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java +29 -0
- data/tracks/java/exercises/robot-simulator/src/example/java/Orientation.java +5 -0
- data/tracks/java/exercises/secret-handshake/src/example/java/Signal.java +5 -0
- data/tracks/java/exercises/sublist/src/example/java/Relationship.java +5 -0
- data/tracks/java/exercises/triangle/src/example/java/TriangleException.java +5 -0
- data/tracks/java/exercises/triangle/src/example/java/TriangleKind.java +5 -0
- data/tracks/julia/config.json +10 -1
- data/tracks/julia/exercises/atbash-cipher/runtests.jl +36 -36
- data/tracks/julia/exercises/pangram/example.jl +2 -0
- data/tracks/julia/exercises/pangram/pangram.jl +4 -0
- data/tracks/julia/exercises/pangram/runtests.jl +40 -0
- data/tracks/perl5/exercises/bob/Example.pm +1 -1
- data/tracks/perl5/exercises/bob/bob.t +27 -31
- data/tracks/php/exercises/accumulate/accumulate_test.php +1 -1
- data/tracks/php/exercises/acronym/acronym_test.php +1 -1
- data/tracks/php/exercises/allergies/allergies_test.php +1 -1
- data/tracks/php/exercises/anagram/anagram_test.php +1 -1
- data/tracks/php/exercises/atbash-cipher/atbash-cipher_test.php +1 -1
- data/tracks/php/exercises/beer-song/beer-song_test.php +1 -1
- data/tracks/php/exercises/binary/binary_test.php +2 -2
- data/tracks/php/exercises/bob/bob_test.php +1 -1
- data/tracks/php/exercises/book-store/book-store_test.php +1 -1
- data/tracks/php/exercises/bowling/bowling_test.php +1 -1
- data/tracks/php/exercises/bracket-push/bracket-push_test.php +1 -1
- data/tracks/php/exercises/change/change_test.php +3 -3
- data/tracks/php/exercises/clock/clock_test.php +1 -1
- data/tracks/php/exercises/connect/connect_test.php +1 -1
- data/tracks/php/exercises/difference-of-squares/difference-of-squares_test.php +1 -1
- data/tracks/php/exercises/etl/etl_test.php +1 -1
- data/tracks/php/exercises/gigasecond/gigasecond_test.php +1 -1
- data/tracks/php/exercises/grains/grains_test.php +1 -1
- data/tracks/php/exercises/hamming/hamming_test.php +2 -2
- data/tracks/php/exercises/hello-world/hello-world_test.php +1 -1
- data/tracks/php/exercises/isogram/isogram_test.php +1 -1
- data/tracks/php/exercises/largest-series-product/largest-series-product_test.php +1 -1
- data/tracks/php/exercises/leap/leap_test.php +1 -1
- data/tracks/php/exercises/markdown/markdown_test.php +1 -1
- data/tracks/php/exercises/minesweeper/minesweeper_test.php +7 -7
- data/tracks/php/exercises/nucleotide-count/nucleotide-count_test.php +1 -1
- data/tracks/php/exercises/ocr-numbers/ocr-numbers_test.php +1 -1
- data/tracks/php/exercises/pangram/pangram_test.php +1 -1
- data/tracks/php/exercises/phone-number/phone-number_test.php +1 -1
- data/tracks/php/exercises/pig-latin/pig-latin_test.php +1 -1
- data/tracks/php/exercises/raindrops/raindrops_test.php +1 -1
- data/tracks/php/exercises/rna-transcription/rna-transcription_test.php +1 -1
- data/tracks/php/exercises/robot-name/robot-name_test.php +1 -1
- data/tracks/php/exercises/robot-simulator/robot-simulator_test.php +1 -1
- data/tracks/php/exercises/roman-numerals/roman-numerals_test.php +1 -1
- data/tracks/php/exercises/sieve/sieve_test.php +1 -1
- data/tracks/php/exercises/space-age/space-age_test.php +1 -1
- data/tracks/php/exercises/triangle/triangle_test.php +1 -1
- data/tracks/php/exercises/trinary/trinary_test.php +1 -1
- data/tracks/php/exercises/variable-length-quantity/variable-length-quantity_test.php +3 -3
- data/tracks/php/exercises/word-count/word-count_test.php +1 -1
- data/tracks/php/exercises/wordy/wordy_test.php +3 -3
- data/tracks/python/config.json +3 -13
- data/tracks/python/exercises/rectangles/rectangles_count_test.py +15 -22
- data/tracks/scala/config.json +684 -665
- data/tracks/scala/exercises/binary-search/build.sbt +3 -0
- data/tracks/scala/exercises/binary-search/example.scala +23 -0
- data/tracks/scala/exercises/binary-search/src/main/scala/BinarySearch.scala +0 -0
- data/tracks/scala/exercises/binary-search/src/test/scala/BinarySearchTest.scala +63 -0
- data/tracks/scala/exercises/strain/build.sbt +3 -0
- data/tracks/scala/exercises/strain/example.scala +22 -0
- data/tracks/scala/exercises/strain/src/main/scala/Strain.scala +0 -0
- data/tracks/scala/exercises/strain/src/test/scala/StrainTest.scala +78 -0
- data/tracks/scala/testgen/src/main/scala/AllYourBaseTestGenerator.scala +13 -20
- data/tracks/scala/testgen/src/main/scala/BinarySearchTestGenerator.scala +48 -0
- data/tracks/scala/testgen/src/main/scala/BowlingTestGenerator.scala +24 -32
- data/tracks/scala/testgen/src/main/scala/CustomSetTestGenerator.scala +148 -112
- data/tracks/scala/testgen/src/main/scala/TestBuilder.scala +86 -0
- metadata +30 -3
- data/tracks/java/exercises/allergies/src/example/java/Allergen.java +0 -1
- data/tracks/java/exercises/meetup/src/example/java/MeetupSchedule.java +0 -1
- data/tracks/java/exercises/perfect-numbers/src/example/java/Classification.java +0 -1
- data/tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java +0 -1
- data/tracks/java/exercises/robot-simulator/src/example/java/Orientation.java +0 -1
- data/tracks/java/exercises/secret-handshake/src/example/java/Signal.java +0 -1
- data/tracks/java/exercises/sublist/src/example/java/Relationship.java +0 -1
- data/tracks/java/exercises/triangle/src/example/java/TriangleException.java +0 -1
- data/tracks/java/exercises/triangle/src/example/java/TriangleKind.java +0 -1
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'minesweeper.php';
|
4
4
|
|
5
|
-
class MinesweeperTest extends
|
5
|
+
class MinesweeperTest extends PHPUnit\Framework\TestCase
|
6
6
|
{
|
7
7
|
public function testAnEmptyBoard()
|
8
8
|
{
|
@@ -22,7 +22,7 @@ class MinesweeperTest extends PHPUnit_Framework_TestCase
|
|
22
22
|
|
|
23
23
|
+--+
|
24
24
|
';
|
25
|
-
$this->
|
25
|
+
$this->expectException('InvalidArgumentException');
|
26
26
|
|
27
27
|
solve($incompleteBoard);
|
28
28
|
}
|
@@ -35,7 +35,7 @@ class MinesweeperTest extends PHPUnit_Framework_TestCase
|
|
35
35
|
| |
|
36
36
|
+--+
|
37
37
|
';
|
38
|
-
$this->
|
38
|
+
$this->expectException('InvalidArgumentException');
|
39
39
|
|
40
40
|
solve($incompleteBoard);
|
41
41
|
}
|
@@ -48,7 +48,7 @@ class MinesweeperTest extends PHPUnit_Framework_TestCase
|
|
48
48
|
| |
|
49
49
|
+--+
|
50
50
|
';
|
51
|
-
$this->
|
51
|
+
$this->expectException('InvalidArgumentException');
|
52
52
|
|
53
53
|
solve($incompleteBoard);
|
54
54
|
}
|
@@ -61,7 +61,7 @@ class MinesweeperTest extends PHPUnit_Framework_TestCase
|
|
61
61
|
| |
|
62
62
|
+-+
|
63
63
|
';
|
64
|
-
$this->
|
64
|
+
$this->expectException('InvalidArgumentException');
|
65
65
|
|
66
66
|
solve($tinyBoard);
|
67
67
|
}
|
@@ -76,7 +76,7 @@ class MinesweeperTest extends PHPUnit_Framework_TestCase
|
|
76
76
|
+---+
|
77
77
|
';
|
78
78
|
|
79
|
-
$this->
|
79
|
+
$this->expectException('InvalidArgumentException');
|
80
80
|
|
81
81
|
solve($unequalBoard);
|
82
82
|
}
|
@@ -92,7 +92,7 @@ class MinesweeperTest extends PHPUnit_Framework_TestCase
|
|
92
92
|
+---+
|
93
93
|
';
|
94
94
|
|
95
|
-
$this->
|
95
|
+
$this->expectException('InvalidArgumentException');
|
96
96
|
|
97
97
|
solve($badBoard);
|
98
98
|
}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require_once 'variable-length-quantity.php';
|
4
4
|
|
5
|
-
class VariableLengthQuantityTest extends
|
5
|
+
class VariableLengthQuantityTest extends PHPUnit\Framework\TestCase
|
6
6
|
{
|
7
7
|
public function testItEncodesSingleBytes()
|
8
8
|
{
|
@@ -111,7 +111,7 @@ class VariableLengthQuantityTest extends PHPUnit_Framework_TestCase
|
|
111
111
|
{
|
112
112
|
$this->markTestSkipped();
|
113
113
|
|
114
|
-
$this->
|
114
|
+
$this->expectException(InvalidArgumentException::class);
|
115
115
|
|
116
116
|
vlq_decode([0xff]);
|
117
117
|
}
|
@@ -120,7 +120,7 @@ class VariableLengthQuantityTest extends PHPUnit_Framework_TestCase
|
|
120
120
|
{
|
121
121
|
$this->markTestSkipped();
|
122
122
|
|
123
|
-
$this->
|
123
|
+
$this->expectException(OverflowException::class);
|
124
124
|
|
125
125
|
vlq_decode([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f]);
|
126
126
|
}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "wordy.php";
|
4
4
|
|
5
|
-
class WordProblemTest extends \
|
5
|
+
class WordProblemTest extends PHPUnit\Framework\TestCase
|
6
6
|
{
|
7
7
|
public function testAdd1()
|
8
8
|
{
|
@@ -90,7 +90,7 @@ class WordProblemTest extends \PHPUnit_Framework_TestCase
|
|
90
90
|
public function testTooAdvanced()
|
91
91
|
{
|
92
92
|
$this->markTestSkipped();
|
93
|
-
$this->
|
93
|
+
$this->expectException('InvalidArgumentException');
|
94
94
|
|
95
95
|
calculate('What is 53 cubed?');
|
96
96
|
}
|
@@ -98,7 +98,7 @@ class WordProblemTest extends \PHPUnit_Framework_TestCase
|
|
98
98
|
public function testIrrelevant()
|
99
99
|
{
|
100
100
|
$this->markTestSkipped();
|
101
|
-
$this->
|
101
|
+
$this->expectException('InvalidArgumentException');
|
102
102
|
|
103
103
|
calculate('Who is the president of the United States?');
|
104
104
|
}
|
data/tracks/python/config.json
CHANGED
@@ -322,12 +322,6 @@
|
|
322
322
|
"topics": [
|
323
323
|
]
|
324
324
|
},
|
325
|
-
{
|
326
|
-
"slug": "binary",
|
327
|
-
"difficulty": 1,
|
328
|
-
"topics": [
|
329
|
-
]
|
330
|
-
},
|
331
325
|
{
|
332
326
|
"slug": "palindrome-products",
|
333
327
|
"difficulty": 1,
|
@@ -340,12 +334,6 @@
|
|
340
334
|
"topics": [
|
341
335
|
]
|
342
336
|
},
|
343
|
-
{
|
344
|
-
"slug": "hexadecimal",
|
345
|
-
"difficulty": 1,
|
346
|
-
"topics": [
|
347
|
-
]
|
348
|
-
},
|
349
337
|
{
|
350
338
|
"slug": "minesweeper",
|
351
339
|
"difficulty": 1,
|
@@ -440,7 +428,9 @@
|
|
440
428
|
"proverb",
|
441
429
|
"raindrops",
|
442
430
|
"strain",
|
443
|
-
"trinary"
|
431
|
+
"trinary",
|
432
|
+
"binary",
|
433
|
+
"hexadecimal"
|
444
434
|
],
|
445
435
|
"ignored": [
|
446
436
|
"docs",
|
@@ -4,69 +4,62 @@ from rectangles import count
|
|
4
4
|
|
5
5
|
|
6
6
|
class WordTest(unittest.TestCase):
|
7
|
-
# unit tests
|
8
7
|
def test_zero_area_1(self):
|
9
|
-
|
8
|
+
self.assertEqual(0, count())
|
10
9
|
|
11
10
|
def test_zero_area_2(self):
|
12
11
|
lines = ""
|
13
|
-
|
12
|
+
self.assertEqual(0, count(lines))
|
14
13
|
|
15
14
|
def test_empty_area(self):
|
16
15
|
lines = " "
|
17
|
-
|
16
|
+
self.assertEqual(0, count(lines))
|
18
17
|
|
19
18
|
def test_one_rectangle(self):
|
20
19
|
lines = ["+-+",
|
21
20
|
"| |",
|
22
|
-
"+-+"
|
23
|
-
|
24
|
-
assert 1 == count(lines)
|
21
|
+
"+-+"]
|
22
|
+
self.assertEqual(1, count(lines))
|
25
23
|
|
26
24
|
def test_two_rectangles_no_shared_parts(self):
|
27
25
|
lines = [" +-+",
|
28
26
|
" | |",
|
29
27
|
"+-+-+",
|
30
28
|
"| | ",
|
31
|
-
"+-+ "
|
32
|
-
|
33
|
-
assert 2 == count(lines)
|
29
|
+
"+-+ "]
|
30
|
+
self.assertEqual(2, count(lines))
|
34
31
|
|
35
32
|
def test_five_rectangles_three_regions(self):
|
36
33
|
lines = [" +-+",
|
37
34
|
" | |",
|
38
35
|
"+-+-+",
|
39
36
|
"| | |",
|
40
|
-
"+-+-+"
|
41
|
-
|
42
|
-
assert 5 == count(lines)
|
37
|
+
"+-+-+"]
|
38
|
+
self.assertEqual(5, count(lines))
|
43
39
|
|
44
40
|
def test_incomplete_rectangles(self):
|
45
41
|
lines = [" +-+",
|
46
42
|
" |",
|
47
43
|
"+-+-+",
|
48
44
|
"| | -",
|
49
|
-
"+-+-+"
|
50
|
-
|
51
|
-
assert 1 == count(lines)
|
45
|
+
"+-+-+"]
|
46
|
+
self.assertEqual(1, count(lines))
|
52
47
|
|
53
48
|
def test_complicated(self):
|
54
49
|
lines = ["+------+----+",
|
55
50
|
"| | |",
|
56
51
|
"+---+--+ |",
|
57
52
|
"| | |",
|
58
|
-
"+---+-------+"
|
59
|
-
|
60
|
-
assert 3 == count(lines)
|
53
|
+
"+---+-------+"]
|
54
|
+
self.assertEqual(3, count(lines))
|
61
55
|
|
62
56
|
def test_not_so_complicated(self):
|
63
57
|
lines = ["+------+----+",
|
64
58
|
"| | |",
|
65
59
|
"+------+ |",
|
66
60
|
"| | |",
|
67
|
-
"+---+-------+"
|
68
|
-
|
69
|
-
assert 2 == count(lines)
|
61
|
+
"+---+-------+"]
|
62
|
+
self.assertEqual(2, count(lines))
|
70
63
|
|
71
64
|
|
72
65
|
if __name__ == '__main__':
|