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
@@ -0,0 +1,5 @@
1
+ enum Classification {
2
+
3
+ DEFICIENT, PERFECT, ABUNDANT
4
+
5
+ }
@@ -0,0 +1,29 @@
1
+ final class GridPosition {
2
+
3
+ final int x;
4
+
5
+ final int y;
6
+
7
+ GridPosition(final int x, final int y) {
8
+ this.x = x;
9
+ this.y = y;
10
+ }
11
+
12
+ /*
13
+ * This equals method is of deliberately narrow scope (only allows comparison with another GridPosition) to increase
14
+ * readability. In general, one should provide a full implementation of Object.equals(Object obj) and a
15
+ * corresponding implementation of Object.hashCode(). See
16
+ *
17
+ * https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)
18
+ *
19
+ * and
20
+ *
21
+ * https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#hashCode()
22
+ *
23
+ * for more information.
24
+ */
25
+ boolean equals(final GridPosition gridPosition) {
26
+ return this.x == gridPosition.x && this.y == gridPosition.y;
27
+ }
28
+
29
+ }
@@ -0,0 +1,5 @@
1
+ enum Orientation {
2
+
3
+ NORTH, EAST, SOUTH, WEST
4
+
5
+ }
@@ -0,0 +1,5 @@
1
+ enum Signal {
2
+
3
+ WINK, DOUBLE_BLINK, CLOSE_YOUR_EYES, JUMP
4
+
5
+ }
@@ -0,0 +1,5 @@
1
+ enum Relationship {
2
+
3
+ EQUAL, SUBLIST, SUPERLIST, UNEQUAL
4
+
5
+ }
@@ -0,0 +1,5 @@
1
+ public class TriangleException extends Exception {
2
+
3
+ public TriangleException() {
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ public enum TriangleKind {
2
+ EQUILATERAL,
3
+ ISOSCELES,
4
+ SCALENE
5
+ }
@@ -69,7 +69,7 @@
69
69
  "topics": [
70
70
  "control-flow (conditionals)",
71
71
  "integers",
72
- "mathematics"
72
+ "mathematics"
73
73
  ]
74
74
  },
75
75
  {
@@ -139,6 +139,15 @@
139
139
  "filtering"
140
140
  ]
141
141
  },
142
+ {
143
+ "slug": "pangram",
144
+ "difficulty": 1,
145
+ "topics": [
146
+ "arrays",
147
+ "strings",
148
+ "filtering"
149
+ ]
150
+ },
142
151
  {
143
152
  "slug": "bob",
144
153
  "difficulty": 2,
@@ -3,54 +3,54 @@ using Base.Test
3
3
  include("atbash-cipher.jl")
4
4
 
5
5
  @testset "encoding from English to atbash" begin
6
- @testset "encode yes" begin
7
- @test encode("yes") == "bvh"
8
- end
6
+ @testset "encode yes" begin
7
+ @test encode("yes") == "bvh"
8
+ end
9
9
 
10
- @testset "encode no" begin
11
- @test encode("no") == "ml"
12
- end
10
+ @testset "encode no" begin
11
+ @test encode("no") == "ml"
12
+ end
13
13
 
14
- @testset "encode OMG" begin
15
- @test encode("OMG") == "lnt"
16
- end
14
+ @testset "encode OMG" begin
15
+ @test encode("OMG") == "lnt"
16
+ end
17
17
 
18
- @testset "encode spaces" begin
19
- @test encode("O M G") == "lnt"
20
- end
18
+ @testset "encode spaces" begin
19
+ @test encode("O M G") == "lnt"
20
+ end
21
21
 
22
- @testset "encode mindblowingly" begin
23
- @test encode("mindblowingly") == "nrmwy oldrm tob"
24
- end
22
+ @testset "encode mindblowingly" begin
23
+ @test encode("mindblowingly") == "nrmwy oldrm tob"
24
+ end
25
25
 
26
- @testset "encode numbers" begin
27
- @test encode("Testing,1 2 3, testing.") == "gvhgr mt123 gvhgr mt"
28
- end
26
+ @testset "encode numbers" begin
27
+ @test encode("Testing,1 2 3, testing.") == "gvhgr mt123 gvhgr mt"
28
+ end
29
29
 
30
- @testset "encode deep thought" begin
31
- @test encode("Truth is fiction.") == "gifgs rhurx grlm"
32
- end
30
+ @testset "encode deep thought" begin
31
+ @test encode("Truth is fiction.") == "gifgs rhurx grlm"
32
+ end
33
33
 
34
- @testset "encode all the letters" begin
35
- @test encode("The quick brown fox jumps over the lazy dog.") == "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
36
- end
34
+ @testset "encode all the letters" begin
35
+ @test encode("The quick brown fox jumps over the lazy dog.") == "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
36
+ end
37
37
  end
38
38
 
39
39
  @testset "decoding from atbash to English" begin
40
- @testset "decode exercism" begin
41
- @test decode("vcvix rhn") == "exercism"
42
- end
40
+ @testset "decode exercism" begin
41
+ @test decode("vcvix rhn") == "exercism"
42
+ end
43
43
 
44
- @testset "decode a sentence" begin
45
- @test decode("zmlyh gzxov rhlug vmzhg vkkrm thglm v") == "anobstacleisoftenasteppingstone"
46
- end
44
+ @testset "decode a sentence" begin
45
+ @test decode("zmlyh gzxov rhlug vmzhg vkkrm thglm v") == "anobstacleisoftenasteppingstone"
46
+ end
47
47
 
48
- @testset "decode numbers" begin
49
- @test decode("gvhgr mt123 gvhgr mt") == "testing123testing"
50
- end
48
+ @testset "decode numbers" begin
49
+ @test decode("gvhgr mt123 gvhgr mt") == "testing123testing"
50
+ end
51
51
 
52
- @testset "decode all the letters" begin
53
- @test decode("gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt") == "thequickbrownfoxjumpsoverthelazydog"
54
- end
52
+ @testset "decode all the letters" begin
53
+ @test decode("gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt") == "thequickbrownfoxjumpsoverthelazydog"
54
+ end
55
55
  end
56
56
 
@@ -0,0 +1,2 @@
1
+ ispangram(input::AbstractString) = length(Set(matchall(r"[a-z]", lowercase(input)))) == 26
2
+
@@ -0,0 +1,4 @@
1
+ function ispangram(input::AbstractString)
2
+
3
+ end
4
+
@@ -0,0 +1,40 @@
1
+ using Base.Test
2
+
3
+ include("pangram.jl")
4
+
5
+ @testset "empty sentence" begin
6
+ @test !ispangram("")
7
+ end
8
+
9
+ @testset "pangram with only lower case" begin
10
+ @test ispangram("the quick brown fox jumps over the lazy dog")
11
+ end
12
+
13
+ @testset "missing character 'x'" begin
14
+ @test !ispangram("a quick movement of the enemy will jeopardize five gunboats")
15
+ end
16
+
17
+ @testset "another missing character 'x'" begin
18
+ @test !ispangram("the quick brown fish jumps over the lazy dog")
19
+ end
20
+
21
+ @testset "pangram with underscores" begin
22
+ @test ispangram("the_quick_brown_fox_jumps_over_the_lazy_dog")
23
+ end
24
+
25
+ @testset "pangram with numbers" begin
26
+ @test ispangram("the 1 quick brown fox jumps over the 2 lazy dogs")
27
+ end
28
+
29
+ @testset "missing letters replaced by numbers" begin
30
+ @test !ispangram("7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog")
31
+ end
32
+
33
+ @testset "pangram with mixed case and punctuation" begin
34
+ @test ispangram("\"Five quacking Zephyrs jolt my wax bed.\"")
35
+ end
36
+
37
+ @testset "upper and lower case versions of the same character should not be counted separately" begin
38
+ @test !ispangram("the quick brown fox jumped over the lazy FOX")
39
+ end
40
+
@@ -10,7 +10,7 @@ sub hey {
10
10
  return 'Whoa, chill out!'
11
11
  if uc($text) eq $text and $text =~ /\p{Uppercase}/;
12
12
  return 'Sure.'
13
- if '?' eq substr $text, -1;
13
+ if $text =~ /\?\s*$/;
14
14
 
15
15
  return 'Whatever.';
16
16
  }
@@ -1,8 +1,6 @@
1
1
  #!/usr/bin/env perl
2
2
  use strict;
3
3
  use warnings;
4
- use open ':std', ':encoding(utf8)';
5
- use utf8;
6
4
  use FindBin;
7
5
  my $dir;
8
6
  BEGIN { $dir = $FindBin::Bin . '/' };
@@ -10,7 +8,7 @@ use lib $dir;
10
8
 
11
9
  my $module = $ENV{EXERCISM} ? 'Example' : 'Bob';
12
10
 
13
- use Test::More;
11
+ use Test::More tests => 28;
14
12
 
15
13
  my @cases = map {
16
14
  {
@@ -19,31 +17,32 @@ my @cases = map {
19
17
  desc => $_->[2],
20
18
  }
21
19
  } (
22
- # input expected output title
23
- ['Tom-ay-to, tom-aaaah-to.', 'Whatever.', 'stating something'],
24
- ['WATCH OUT!', 'Whoa, chill out!', 'shouting'],
25
- ['Does this cryogenic chamber make me look fat?', 'Sure.', 'question'],
26
- ['You are, what, like 15?', 'Sure.', 'numeric question'],
27
- ["Let's go make out behind the gym!", 'Whatever.', 'talking forcefully'],
28
- ["It's OK if you don't want to go to the DMV.", 'Whatever.', 'using acronyms in regular speech'],
29
- ['WHAT THE HELL WERE YOU THINKING?', 'Whoa, chill out!', 'forceful questions'],
30
- ['1, 2, 3 GO!', 'Whoa, chill out!', 'shouting numbers'],
31
- ['1, 2, 3', 'Whatever.', 'only numbers'],
32
- ['4?', 'Sure.', 'question with only numbers'],
33
- ['ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!', 'Whoa, chill out!', 'shouting with special characters'],
34
- ["ÜMLÄÜTS!", 'Whoa, chill out!', 'shouting with umlauts'],
35
- ["\xdcML\xc4\xdcTS!", 'Whoa, chill out!', 'shouting with umlauts'],
36
- ['_A', 'Whoa, chill out!', 'underscore shout - before'],
37
- ['A_', 'Whoa, chill out!', 'underscore shout - after'],
38
- ['$A', 'Whoa, chill out!', 'Dollar sign shout - before'],
39
- ['A$', 'Whoa, chill out!', 'Dollar sign shout - after'],
40
- ["ÜMLäÜTS!", 'Whatever.', 'speaking calmly with umlauts'],
41
- ['I HATE YOU', 'Whoa, chill out!', 'shouting with no exclamation mark'],
42
- ['Ending with ? means a question.', 'Whatever.', 'statement containing question mark'],
43
- ["Wait! Hang on. Are you going to be OK?", 'Sure.', 'prattling on'],
44
- ['', 'Fine. Be that way!', 'silence'],
45
- [' ', 'Fine. Be that way!', 'prolonged silence'],
46
- [" \nI just remembered...", 'Whatever.', 'Silence, then more'],
20
+ # input expected output title
21
+ ['Tom-ay-to, tom-aaaah-to.', 'Whatever.', 'stating something'],
22
+ ['WATCH OUT!', 'Whoa, chill out!', 'shouting'],
23
+ ['FCECDFCAAB', 'Whoa, chill out!', 'shouting gibberish'],
24
+ ['Does this cryogenic chamber make me look fat?', 'Sure.', 'asking a question'],
25
+ ['You are, what, like 15?', 'Sure.', 'asking a numeric question'],
26
+ ['fffbbcbeab?', 'Sure.', 'asking gibberish'],
27
+ ["Let's go make out behind the gym!", 'Whatever.', 'talking forcefully'],
28
+ ["It's OK if you don't want to go to the DMV.", 'Whatever.', 'using acronyms in regular speech'],
29
+ ['WHAT THE HELL WERE YOU THINKING?', 'Whoa, chill out!', 'forceful question'],
30
+ ['1, 2, 3 GO!', 'Whoa, chill out!', 'shouting numbers'],
31
+ ['1, 2, 3', 'Whatever.', 'only numbers'],
32
+ ['4?', 'Sure.', 'question with only numbers'],
33
+ ['ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!', 'Whoa, chill out!', 'shouting with special characters'],
34
+ ['I HATE YOU', 'Whoa, chill out!', 'shouting with no exclamation mark'],
35
+ ['Ending with ? means a question.', 'Whatever.', 'statement containing question mark'],
36
+ [':) ?', 'Sure.', 'non-letters with question'],
37
+ ["Wait! Hang on. Are you going to be OK?", 'Sure.', 'prattling on'],
38
+ ['', 'Fine. Be that way!', 'silence'],
39
+ [' ', 'Fine. Be that way!', 'prolonged silence'],
40
+ ["\t\t\t\t\t\t\t\t\t\t", 'Fine. Be that way!', 'alternate silence'],
41
+ ["\nDoes this cryogenic chamber make me look fat?\nno", 'Whatever.', 'multiple line question'],
42
+ [' hmmmmmmm...', 'Whatever.', 'starting with whitespace'],
43
+ ['Okay if like my spacebar quite a bit? ', 'Sure.', 'ending with whitespace'],
44
+ ["\n\r \t", 'Fine. Be that way!', 'other whitespace'],
45
+ ['This is a statement ending with whitespace ', 'Whatever.', 'non-question ending with whitespace'],
47
46
  );
48
47
 
49
48
  ok -e "${dir}${module}.pm", "missing $module.pm"
@@ -58,9 +57,6 @@ can_ok($module, 'hey')
58
57
  my $sub = $module->can('hey');
59
58
 
60
59
  foreach my $c (@cases) {
61
- #diag uc $c->{input};
62
60
  my $title = $c->{desc} ? "$c->{desc}: $c->{input}" : $c->{input};
63
61
  is $sub->( $c->{input} ), $c->{expect}, $title;
64
62
  }
65
-
66
- done_testing();
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_once 'accumulate.php';
4
4
 
5
- class AccumulateTest extends PHPUnit_Framework_TestCase
5
+ class AccumulateTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testAccumulateEmpty()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_once 'acronym.php';
4
4
 
5
- class AcronymTest extends PHPUnit_Framework_TestCase
5
+ class AcronymTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testBasicTitleCase()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "allergies.php";
4
4
 
5
- class AllergiesTest extends \PHPUnit_Framework_TestCase
5
+ class AllergiesTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
 
8
8
  /**
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "anagram.php";
4
4
 
5
- class AnagramTest extends PHPUnit_Framework_TestCase
5
+ class AnagramTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testNoMatches()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "atbash-cipher.php";
4
4
 
5
- class AtbashTest extends \PHPUnit_Framework_TestCase
5
+ class AtbashTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testEncodeNo()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "beer-song.php";
4
4
 
5
- class BeerSongTest extends \PHPUnit_Framework_TestCase
5
+ class BeerSongTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testFirstVerse()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_once 'binary.php';
4
4
 
5
- class BinaryTest extends \PHPUnit_Framework_TestCase
5
+ class BinaryTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testItParsesBinary0ToDecimal0()
8
8
  {
@@ -60,7 +60,7 @@ class BinaryTest extends \PHPUnit_Framework_TestCase
60
60
  {
61
61
  $this->markTestSkipped();
62
62
 
63
- $this->setExpectedException(InvalidArgumentException::class);
63
+ $this->expectException(InvalidArgumentException::class);
64
64
 
65
65
  parse_binary($value);
66
66
  }
@@ -1,7 +1,7 @@
1
1
  <?php
2
2
  require_once "bob.php";
3
3
 
4
- class BobTest extends PHPUnit_Framework_TestCase
4
+ class BobTest extends PHPUnit\Framework\TestCase
5
5
  {
6
6
 
7
7
  /**
@@ -9,7 +9,7 @@ include_once 'book-store.php';
9
9
  * any single book in a grouping.
10
10
  */
11
11
 
12
- class BookStoreTest extends PHPUnit_Framework_TestCase
12
+ class BookStoreTest extends PHPUnit\Framework\TestCase
13
13
  {
14
14
 
15
15
  /**
@@ -6,7 +6,7 @@ require "bowling.php";
6
6
  * Translated from original source:
7
7
  * http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata
8
8
  */
9
- class GameTest extends \PHPUnit_Framework_TestCase
9
+ class GameTest extends PHPUnit\Framework\TestCase
10
10
  {
11
11
  /** @var Game */
12
12
  private $game;
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_once "bracket-push.php";
4
4
 
5
- class BracketTest extends PHPUnit_Framework_TestCase
5
+ class BracketTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testPairedSquareBrackets()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "change.php";
4
4
 
5
- class ChangeTest extends PHPUnit_Framework_TestCase
5
+ class ChangeTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testSingleCoinChange()
8
8
  {
@@ -39,7 +39,7 @@ class ChangeTest extends PHPUnit_Framework_TestCase
39
39
  public function testForChangeSmallerThanAvailableCoins()
40
40
  {
41
41
  $this->markTestSkipped();
42
- $this->setExpectedException('InvalidArgumentException', 'No coins small enough to make change');
42
+ $this->expectException('InvalidArgumentException', 'No coins small enough to make change');
43
43
  findFewestCoins(array(5, 10), 3);
44
44
  }
45
45
 
@@ -52,7 +52,7 @@ class ChangeTest extends PHPUnit_Framework_TestCase
52
52
  public function testChangeValueLessThanZero()
53
53
  {
54
54
  $this->markTestSkipped();
55
- $this->setExpectedException('InvalidArgumentException', 'Cannot make change for negative value');
55
+ $this->expectException('InvalidArgumentException', 'Cannot make change for negative value');
56
56
  findFewestCoins(array(1, 2, 5), -5);
57
57
  }
58
58
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "clock.php";
4
4
 
5
- class ClockTest extends \PHPUnit_Framework_TestCase
5
+ class ClockTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testOnTheHour()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "connect.php";
4
4
 
5
- class ConnectTest extends \PHPUnit_Framework_TestCase
5
+ class ConnectTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  /**
8
8
  * Strip off the spaces which are only for readability.
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_once "difference-of-squares.php";
4
4
 
5
- class SquaresTest extends PHPUnit_Framework_TestCase
5
+ class SquaresTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testSquareOfSumsTo5()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "etl.php";
4
4
 
5
- class TransformTest extends PHPUnit_Framework_TestCase
5
+ class TransformTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testTransformOneValue()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "gigasecond.php";
4
4
 
5
- class GigasecondTest extends \PHPUnit_Framework_TestCase
5
+ class GigasecondTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
 
8
8
  public function dateSetup($date)
@@ -2,7 +2,7 @@
2
2
 
3
3
  include_once 'grains.php';
4
4
 
5
- class GrainsTest extends PHPUnit_Framework_TestCase
5
+ class GrainsTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  /**
8
8
  * PHP integers greater than 2^31 (32-bit systems)
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "hamming.php";
4
4
 
5
- class HammingComparatorTest extends PHPUnit_Framework_TestCase
5
+ class HammingComparatorTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
 
8
8
  public function testNoDifferenceBetweenIdenticalStrands()
@@ -49,7 +49,7 @@ class HammingComparatorTest extends PHPUnit_Framework_TestCase
49
49
  public function testExceptionThrownWhenStrandsAreDifferentLength()
50
50
  {
51
51
  $this->markTestSkipped();
52
- $this->setExpectedException('InvalidArgumentException', 'DNA strands must be of equal length.');
52
+ $this->expectException('InvalidArgumentException', 'DNA strands must be of equal length.');
53
53
  distance('GGACG', 'AGGACGTGG');
54
54
  }
55
55
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "hello-world.php";
4
4
 
5
- class HelloWorldTest extends \PHPUnit_Framework_TestCase
5
+ class HelloWorldTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testNoName()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "isogram.php";
4
4
 
5
- class IsogramTest extends PHPUnit_Framework_TestCase
5
+ class IsogramTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testIsogram()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  include_once 'largest-series-product.php';
4
4
 
5
- class SeriesTest extends PHPUnit_Framework_TestCase
5
+ class SeriesTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  /**
8
8
  * Since PHP can only support Integers between +/- 9223372036854775807
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "leap.php";
4
4
 
5
- class YearTest extends \PHPUnit_Framework_TestCase
5
+ class YearTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testLeapYear()
8
8
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'markdown.php';
4
4
 
5
- class MarkdownTest extends \PHPUnit_Framework_TestCase
5
+ class MarkdownTest extends PHPUnit\Framework\TestCase
6
6
  {
7
7
  public function testParsingParagraph()
8
8
  {