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.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/common/exercises/book-store/canonical-data.json +7 -1
  3. data/common/exercises/rotational-cipher/{cannonical-data.json → canonical-data.json} +0 -0
  4. data/lib/trackler/version.rb +1 -1
  5. data/tracks/c/config.json +9 -0
  6. data/tracks/c/exercises/triangle/makefile +16 -0
  7. data/tracks/c/exercises/triangle/src/example.c +33 -0
  8. data/tracks/c/exercises/triangle/src/example.h +15 -0
  9. data/tracks/c/exercises/triangle/src/triangle.h +10 -0
  10. data/tracks/c/exercises/triangle/test/test_triangle.c +121 -0
  11. data/tracks/c/exercises/triangle/test/vendor/unity.c +1300 -0
  12. data/tracks/c/exercises/triangle/test/vendor/unity.h +274 -0
  13. data/tracks/c/exercises/triangle/test/vendor/unity_internals.h +701 -0
  14. data/tracks/clojure/.gitignore +1 -0
  15. data/tracks/clojure/_src/clock_generator.clj +5 -0
  16. data/tracks/clojure/_src/generator.clj +72 -0
  17. data/tracks/clojure/config.json +6 -0
  18. data/tracks/clojure/exercises/clock/clock.mustache +34 -0
  19. data/tracks/clojure/exercises/clock/project.clj +4 -0
  20. data/tracks/clojure/exercises/clock/src/example.clj +19 -0
  21. data/tracks/clojure/exercises/clock/test/clock_test.clj +177 -0
  22. data/tracks/clojure/project.clj +4 -1
  23. data/tracks/csharp/exercises/poker/Example.cs +1 -1
  24. data/tracks/csharp/exercises/poker/PokerTest.cs +10 -0
  25. data/tracks/erlang/docs/INSTALLATION.md +14 -3
  26. data/tracks/erlang/docs/LEARNING.md +1 -0
  27. data/tracks/go/exercises/gigasecond/gigasecond_test.go +5 -2
  28. data/tracks/go/exercises/grade-school/example.go +2 -0
  29. data/tracks/go/exercises/grade-school/grade_school_test.go +8 -0
  30. data/tracks/go/exercises/hamming/hamming_test.go +1 -1
  31. data/tracks/go/exercises/hello-world/hello_test.go +6 -4
  32. data/tracks/haskell/exercises/accumulate/src/Accumulate.hs +1 -1
  33. data/tracks/haskell/exercises/anagram/src/Anagram.hs +1 -1
  34. data/tracks/java/bin/journey-test.sh +21 -4
  35. data/tracks/java/exercises/allergies/src/example/java/Allergen.java +20 -0
  36. data/tracks/java/exercises/hamming/src/test/java/HammingTest.java +10 -3
  37. data/tracks/java/exercises/luhn/src/example/java/LuhnValidator.java +19 -11
  38. data/tracks/java/exercises/luhn/src/test/java/LuhnValidatorTest.java +43 -1
  39. data/tracks/java/exercises/meetup/src/example/java/MeetupSchedule.java +8 -0
  40. data/tracks/java/exercises/meetup/src/test/java/MeetupTest.java +91 -91
  41. data/tracks/java/exercises/perfect-numbers/src/example/java/Classification.java +5 -0
  42. data/tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java +29 -0
  43. data/tracks/java/exercises/robot-simulator/src/example/java/Orientation.java +5 -0
  44. data/tracks/java/exercises/secret-handshake/src/example/java/Signal.java +5 -0
  45. data/tracks/java/exercises/sublist/src/example/java/Relationship.java +5 -0
  46. data/tracks/java/exercises/triangle/src/example/java/TriangleException.java +5 -0
  47. data/tracks/java/exercises/triangle/src/example/java/TriangleKind.java +5 -0
  48. data/tracks/julia/config.json +10 -1
  49. data/tracks/julia/exercises/atbash-cipher/runtests.jl +36 -36
  50. data/tracks/julia/exercises/pangram/example.jl +2 -0
  51. data/tracks/julia/exercises/pangram/pangram.jl +4 -0
  52. data/tracks/julia/exercises/pangram/runtests.jl +40 -0
  53. data/tracks/perl5/exercises/bob/Example.pm +1 -1
  54. data/tracks/perl5/exercises/bob/bob.t +27 -31
  55. data/tracks/php/exercises/accumulate/accumulate_test.php +1 -1
  56. data/tracks/php/exercises/acronym/acronym_test.php +1 -1
  57. data/tracks/php/exercises/allergies/allergies_test.php +1 -1
  58. data/tracks/php/exercises/anagram/anagram_test.php +1 -1
  59. data/tracks/php/exercises/atbash-cipher/atbash-cipher_test.php +1 -1
  60. data/tracks/php/exercises/beer-song/beer-song_test.php +1 -1
  61. data/tracks/php/exercises/binary/binary_test.php +2 -2
  62. data/tracks/php/exercises/bob/bob_test.php +1 -1
  63. data/tracks/php/exercises/book-store/book-store_test.php +1 -1
  64. data/tracks/php/exercises/bowling/bowling_test.php +1 -1
  65. data/tracks/php/exercises/bracket-push/bracket-push_test.php +1 -1
  66. data/tracks/php/exercises/change/change_test.php +3 -3
  67. data/tracks/php/exercises/clock/clock_test.php +1 -1
  68. data/tracks/php/exercises/connect/connect_test.php +1 -1
  69. data/tracks/php/exercises/difference-of-squares/difference-of-squares_test.php +1 -1
  70. data/tracks/php/exercises/etl/etl_test.php +1 -1
  71. data/tracks/php/exercises/gigasecond/gigasecond_test.php +1 -1
  72. data/tracks/php/exercises/grains/grains_test.php +1 -1
  73. data/tracks/php/exercises/hamming/hamming_test.php +2 -2
  74. data/tracks/php/exercises/hello-world/hello-world_test.php +1 -1
  75. data/tracks/php/exercises/isogram/isogram_test.php +1 -1
  76. data/tracks/php/exercises/largest-series-product/largest-series-product_test.php +1 -1
  77. data/tracks/php/exercises/leap/leap_test.php +1 -1
  78. data/tracks/php/exercises/markdown/markdown_test.php +1 -1
  79. data/tracks/php/exercises/minesweeper/minesweeper_test.php +7 -7
  80. data/tracks/php/exercises/nucleotide-count/nucleotide-count_test.php +1 -1
  81. data/tracks/php/exercises/ocr-numbers/ocr-numbers_test.php +1 -1
  82. data/tracks/php/exercises/pangram/pangram_test.php +1 -1
  83. data/tracks/php/exercises/phone-number/phone-number_test.php +1 -1
  84. data/tracks/php/exercises/pig-latin/pig-latin_test.php +1 -1
  85. data/tracks/php/exercises/raindrops/raindrops_test.php +1 -1
  86. data/tracks/php/exercises/rna-transcription/rna-transcription_test.php +1 -1
  87. data/tracks/php/exercises/robot-name/robot-name_test.php +1 -1
  88. data/tracks/php/exercises/robot-simulator/robot-simulator_test.php +1 -1
  89. data/tracks/php/exercises/roman-numerals/roman-numerals_test.php +1 -1
  90. data/tracks/php/exercises/sieve/sieve_test.php +1 -1
  91. data/tracks/php/exercises/space-age/space-age_test.php +1 -1
  92. data/tracks/php/exercises/triangle/triangle_test.php +1 -1
  93. data/tracks/php/exercises/trinary/trinary_test.php +1 -1
  94. data/tracks/php/exercises/variable-length-quantity/variable-length-quantity_test.php +3 -3
  95. data/tracks/php/exercises/word-count/word-count_test.php +1 -1
  96. data/tracks/php/exercises/wordy/wordy_test.php +3 -3
  97. data/tracks/python/config.json +3 -13
  98. data/tracks/python/exercises/rectangles/rectangles_count_test.py +15 -22
  99. data/tracks/scala/config.json +684 -665
  100. data/tracks/scala/exercises/binary-search/build.sbt +3 -0
  101. data/tracks/scala/exercises/binary-search/example.scala +23 -0
  102. data/tracks/scala/exercises/binary-search/src/main/scala/BinarySearch.scala +0 -0
  103. data/tracks/scala/exercises/binary-search/src/test/scala/BinarySearchTest.scala +63 -0
  104. data/tracks/scala/exercises/strain/build.sbt +3 -0
  105. data/tracks/scala/exercises/strain/example.scala +22 -0
  106. data/tracks/scala/exercises/strain/src/main/scala/Strain.scala +0 -0
  107. data/tracks/scala/exercises/strain/src/test/scala/StrainTest.scala +78 -0
  108. data/tracks/scala/testgen/src/main/scala/AllYourBaseTestGenerator.scala +13 -20
  109. data/tracks/scala/testgen/src/main/scala/BinarySearchTestGenerator.scala +48 -0
  110. data/tracks/scala/testgen/src/main/scala/BowlingTestGenerator.scala +24 -32
  111. data/tracks/scala/testgen/src/main/scala/CustomSetTestGenerator.scala +148 -112
  112. data/tracks/scala/testgen/src/main/scala/TestBuilder.scala +86 -0
  113. metadata +30 -3
  114. data/tracks/java/exercises/allergies/src/example/java/Allergen.java +0 -1
  115. data/tracks/java/exercises/meetup/src/example/java/MeetupSchedule.java +0 -1
  116. data/tracks/java/exercises/perfect-numbers/src/example/java/Classification.java +0 -1
  117. data/tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java +0 -1
  118. data/tracks/java/exercises/robot-simulator/src/example/java/Orientation.java +0 -1
  119. data/tracks/java/exercises/secret-handshake/src/example/java/Signal.java +0 -1
  120. data/tracks/java/exercises/sublist/src/example/java/Relationship.java +0 -1
  121. data/tracks/java/exercises/triangle/src/example/java/TriangleException.java +0 -1
  122. 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 PHPUnit_Framework_TestCase
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->setExpectedException('InvalidArgumentException');
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->setExpectedException('InvalidArgumentException');
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->setExpectedException('InvalidArgumentException');
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->setExpectedException('InvalidArgumentException');
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->setExpectedException('InvalidArgumentException');
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->setExpectedException('InvalidArgumentException');
95
+ $this->expectException('InvalidArgumentException');
96
96
 
97
97
  solve($badBoard);
98
98
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "nucleotide-count.php";
4
4
 
5
- class NucleotideCountTest extends \PHPUnit_Framework_TestCase
5
+ class NucleotideCountTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testEmptyDNASequence()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  include_once 'ocr-numbers.php';
4
4
 
5
- class OcrNumbersTest extends PHPUnit_Framework_TestCase
5
+ class OcrNumbersTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
 
8
8
  /**
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "pangram.php";
4
4
 
5
- class PangramTest extends PHPUnit_Framework_TestCase
5
+ class PangramTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testSentenceEmpty()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "phone-number.php";
4
4
 
5
- class PhoneNumberTest extends \PHPUnit_Framework_TestCase
5
+ class PhoneNumberTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testCleansNumber()
8
8
  {
@@ -1,7 +1,7 @@
1
1
  <?php
2
2
  require_once "pig-latin.php";
3
3
 
4
- class PigLatinTest extends PHPUnit_Framework_TestCase
4
+ class PigLatinTest extends PHPUnit\Framework\TestCase
5
5
  {
6
6
  public function testWordBeginningWithP()
7
7
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "raindrops.php";
4
4
 
5
- class RaindropsTest extends PHPUnit_Framework_TestCase
5
+ class RaindropsTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function test1()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "rna-transcription.php";
4
4
 
5
- class ComplementTest extends \PHPUnit_Framework_TestCase
5
+ class ComplementTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testTranscribesGuanineToCytosine()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_once "robot-name.php";
4
4
 
5
- class RobotTest extends PHPUnit_Framework_TestCase
5
+ class RobotTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  /** @var Robot $robot */
8
8
  protected $robot = null;
@@ -2,7 +2,7 @@
2
2
 
3
3
  include_once 'robot-simulator.php';
4
4
 
5
- class RobotSimulatorTest extends PHPUnit_Framework_TestCase
5
+ class RobotSimulatorTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
 
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_once "roman-numerals.php";
4
4
 
5
- class RomanTest extends PHPUnit_Framework_TestCase
5
+ class RomanTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function test1()
8
8
  {
@@ -1,6 +1,6 @@
1
1
  <?php
2
2
  require "sieve.php";
3
- class SieveTest extends PHPUnit_Framework_TestCase
3
+ class SieveTest extends PHPUnit\Framework\TestCase
4
4
  {
5
5
  public function testNoPrimesUnderTwo()
6
6
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "space-age.php";
4
4
 
5
- class SpaceAgeTester extends PHPUnit_Framework_TestCase
5
+ class SpaceAgeTester extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  const DELTA = 0.01;
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "triangle.php";
4
4
 
5
- class TriangleTest extends \PHPUnit_Framework_TestCase
5
+ class TriangleTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testEquilateralTrianglesHaveEqualSides()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "trinary.php";
4
4
 
5
- class TrinaryTest extends \PHPUnit_Framework_TestCase
5
+ class TrinaryTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function test1IsDecimal1()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_once 'variable-length-quantity.php';
4
4
 
5
- class VariableLengthQuantityTest extends PHPUnit_Framework_TestCase
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->setExpectedException(InvalidArgumentException::class);
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->setExpectedException(OverflowException::class);
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 "word-count.php";
4
4
 
5
- class WordCountTest extends PHPUnit_Framework_TestCase
5
+ class WordCountTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testCountOneWord()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "wordy.php";
4
4
 
5
- class WordProblemTest extends \PHPUnit_Framework_TestCase
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->setExpectedException('InvalidArgumentException');
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->setExpectedException('InvalidArgumentException');
101
+ $this->expectException('InvalidArgumentException');
102
102
 
103
103
  calculate('Who is the president of the United States?');
104
104
  }
@@ -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
- assert 0 == count()
8
+ self.assertEqual(0, count())
10
9
 
11
10
  def test_zero_area_2(self):
12
11
  lines = ""
13
- assert 0 == count(lines)
12
+ self.assertEqual(0, count(lines))
14
13
 
15
14
  def test_empty_area(self):
16
15
  lines = " "
17
- assert 0 == count(lines)
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__':