trackler 2.2.1.36 → 2.2.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/bash/config.json +1 -0
- data/tracks/ecmascript/README.md +2 -2
- data/tracks/haskell/config/maintainers.json +2 -2
- data/tracks/java/config.json +15 -3
- data/tracks/java/exercises/difference-of-squares/src/test/java/DifferenceOfSquaresCalculatorTest.java +9 -9
- data/tracks/ruby/exercises/palindrome-products/README.md +12 -6
- data/tracks/ruby/exercises/space-age/.meta/generator/test_template.erb +1 -1
- data/tracks/ruby/lib/generator/template_values.rb +6 -0
- data/tracks/ruby/lib/generator/test_template.erb +1 -1
- data/tracks/ruby/test/generator/template_values_test.rb +3 -3
- data/tracks/rust/exercises/accumulate/.gitignore +7 -0
- data/tracks/rust/exercises/clock/.gitignore +7 -0
- data/tracks/rust/exercises/nth-prime/.gitignore +7 -0
- data/tracks/rust/exercises/pig-latin/.gitignore +7 -0
- data/tracks/rust/exercises/prime-factors/.gitignore +7 -0
- data/tracks/rust/exercises/proverb/.gitignore +7 -0
- data/tracks/rust/exercises/pythagorean-triplet/.gitignore +7 -0
- data/tracks/rust/exercises/run-length-encoding/.gitignore +7 -0
- data/tracks/rust/exercises/say/.gitignore +7 -0
- data/tracks/scala/config.json +1 -0
- data/tracks/scala/exercises/clock/src/test/scala/ClockTest.scala +73 -79
- data/tracks/scala/exercises/forth/src/test/scala/ForthTest.scala +128 -133
- data/tracks/scala/exercises/kindergarten-garden/example.scala +1 -1
- data/tracks/scala/exercises/kindergarten-garden/src/test/scala/GardenTest.scala +77 -52
- data/tracks/scala/exercises/nucleotide-count/src/main/scala/.keep +0 -0
- data/tracks/scala/exercises/nucleotide-count/src/test/scala/NucleotideCountTest.scala +21 -61
- data/tracks/scala/exercises/palindrome-products/example.scala +7 -4
- data/tracks/scala/exercises/palindrome-products/src/test/scala/PalindromeProductsTest.scala +54 -34
- data/tracks/scala/testgen/src/main/scala/ClockTestGenerator.scala +66 -0
- data/tracks/scala/testgen/src/main/scala/ForthTestGenerator.scala +66 -0
- data/tracks/scala/testgen/src/main/scala/KindergartenGardenTestGenerator.scala +48 -0
- data/tracks/scala/testgen/src/main/scala/NucleotideCountTestGenerator.scala +34 -0
- data/tracks/scala/testgen/src/main/scala/PalindromeProductsTestGenerator.scala +50 -0
- data/tracks/scala/testgen/src/main/scala/testgen/CanonicalDataParser.scala +7 -6
- data/tracks/sml/config.json +21 -0
- data/tracks/sml/exercises/phone-number/README.md +64 -0
- data/tracks/sml/exercises/phone-number/example.sml +18 -0
- data/tracks/sml/exercises/phone-number/phone-number.sml +2 -0
- data/tracks/sml/exercises/phone-number/test.sml +50 -0
- data/tracks/sml/exercises/phone-number/testlib.sml +159 -0
- data/tracks/sml/exercises/roman-numerals/README.md +79 -0
- data/tracks/sml/exercises/roman-numerals/example.sml +27 -0
- data/tracks/sml/exercises/roman-numerals/roman-numerals.sml +2 -0
- data/tracks/sml/exercises/roman-numerals/test.sml +66 -0
- data/tracks/sml/exercises/roman-numerals/testlib.sml +159 -0
- metadata +26 -3
- data/tracks/scala/exercises/nucleotide-count/src/main/scala/DNA.scala +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad84e4a8d88075679edfbdd19d33960379abd6b9
|
|
4
|
+
data.tar.gz: 6b2b8da9a950f3e6a8a20519e03b34714e151916
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b2e29119464f07bbfc8eef01b406fbac92996900385f5f86754093749a56c6703e501487bf1f65e080ad04c2e4be2c43b1cd3fe45fd9d6d0690438bb19e9f497
|
|
7
|
+
data.tar.gz: 5189f5e61c75cfdfe895602c768aa10ee3f694f71a9ac3847e6c408a8fbc79ad5f527b6d8d266df6b4ab6af69b5affa3b02a483035219c6d169bea1f2701bbff
|
data/lib/trackler/version.rb
CHANGED
data/tracks/bash/config.json
CHANGED
data/tracks/ecmascript/README.md
CHANGED
|
@@ -7,8 +7,8 @@ Exercism exercises in ECMAScript 6
|
|
|
7
7
|
|
|
8
8
|
## Running the Unit Test Suite
|
|
9
9
|
|
|
10
|
-
[Node.js](https://nodejs.org) must be installed. Follow
|
|
11
|
-
We recommend using the latest
|
|
10
|
+
[Node.js](https://nodejs.org) must be installed. Follow these [instructions](http://exercism.io/languages/ecmascript/installation) for installing nodejs.
|
|
11
|
+
We recommend using the latest LTS version.
|
|
12
12
|
|
|
13
13
|
Use `npm` to install all required dependencies:
|
|
14
14
|
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"github_username": "rbasso",
|
|
25
|
-
"show_on_website":
|
|
26
|
-
"alumnus":
|
|
25
|
+
"show_on_website": false,
|
|
26
|
+
"alumnus": true,
|
|
27
27
|
"name": null,
|
|
28
28
|
"bio": "In a world plagued by mutability, where side-effects scorch the land, a hobbyist programmer joins a fellowship of coders to save The Source.",
|
|
29
29
|
"link_text": null,
|
data/tracks/java/config.json
CHANGED
|
@@ -43,7 +43,11 @@
|
|
|
43
43
|
"core": true,
|
|
44
44
|
"difficulty": 3,
|
|
45
45
|
"slug": "hamming",
|
|
46
|
-
"topics":
|
|
46
|
+
"topics": [
|
|
47
|
+
"strings",
|
|
48
|
+
"loops",
|
|
49
|
+
"integers"
|
|
50
|
+
],
|
|
47
51
|
"unlocked_by": null,
|
|
48
52
|
"uuid": "ce899ca6-9cc7-47ba-b76f-1bbcf2630b76"
|
|
49
53
|
},
|
|
@@ -51,7 +55,11 @@
|
|
|
51
55
|
"core": true,
|
|
52
56
|
"difficulty": 3,
|
|
53
57
|
"slug": "gigasecond",
|
|
54
|
-
"topics":
|
|
58
|
+
"topics": [
|
|
59
|
+
"dates",
|
|
60
|
+
"time",
|
|
61
|
+
"integers"
|
|
62
|
+
],
|
|
55
63
|
"unlocked_by": null,
|
|
56
64
|
"uuid": "bf1641c8-dc0d-4d38-9cfe-b4c132ea3553"
|
|
57
65
|
},
|
|
@@ -299,7 +307,11 @@
|
|
|
299
307
|
"core": false,
|
|
300
308
|
"difficulty": 5,
|
|
301
309
|
"slug": "bob",
|
|
302
|
-
"topics":
|
|
310
|
+
"topics": [
|
|
311
|
+
"strings",
|
|
312
|
+
"booleans",
|
|
313
|
+
"conditionals"
|
|
314
|
+
],
|
|
303
315
|
"unlocked_by": "two-fer",
|
|
304
316
|
"uuid": "34cd328c-cd96-492b-abd4-2b8716cdcd9a"
|
|
305
317
|
},
|
|
@@ -17,7 +17,7 @@ public class DifferenceOfSquaresCalculatorTest {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
@Test
|
|
20
|
-
public void
|
|
20
|
+
public void testSquareOfSumUpToOne() {
|
|
21
21
|
final int expected = 1;
|
|
22
22
|
final int actual = calculator.computeSquareOfSumTo(1);
|
|
23
23
|
assertEquals(expected, actual);
|
|
@@ -25,7 +25,7 @@ public class DifferenceOfSquaresCalculatorTest {
|
|
|
25
25
|
|
|
26
26
|
@Ignore("Remove to run test")
|
|
27
27
|
@Test
|
|
28
|
-
public void
|
|
28
|
+
public void testSquareOfSumUpToFive() {
|
|
29
29
|
final int expected = 225;
|
|
30
30
|
final int actual = calculator.computeSquareOfSumTo(5);
|
|
31
31
|
assertEquals(expected, actual);
|
|
@@ -33,7 +33,7 @@ public class DifferenceOfSquaresCalculatorTest {
|
|
|
33
33
|
|
|
34
34
|
@Ignore("Remove to run test")
|
|
35
35
|
@Test
|
|
36
|
-
public void
|
|
36
|
+
public void testSquareOfSumUpToHundred() {
|
|
37
37
|
final int expected = 25502500;
|
|
38
38
|
final int actual = calculator.computeSquareOfSumTo(100);
|
|
39
39
|
assertEquals(expected, actual);
|
|
@@ -41,7 +41,7 @@ public class DifferenceOfSquaresCalculatorTest {
|
|
|
41
41
|
|
|
42
42
|
@Ignore("Remove to run test")
|
|
43
43
|
@Test
|
|
44
|
-
public void
|
|
44
|
+
public void testSumOfSquaresUpToOne() {
|
|
45
45
|
final int expected = 1;
|
|
46
46
|
final int actual = calculator.computeSumOfSquaresTo(1);
|
|
47
47
|
assertEquals(expected, actual);
|
|
@@ -49,7 +49,7 @@ public class DifferenceOfSquaresCalculatorTest {
|
|
|
49
49
|
|
|
50
50
|
@Ignore("Remove to run test")
|
|
51
51
|
@Test
|
|
52
|
-
public void
|
|
52
|
+
public void testSumOfSquaresUpToFive() {
|
|
53
53
|
final int expected = 55;
|
|
54
54
|
final int actual = calculator.computeSumOfSquaresTo(5);
|
|
55
55
|
assertEquals(expected, actual);
|
|
@@ -57,7 +57,7 @@ public class DifferenceOfSquaresCalculatorTest {
|
|
|
57
57
|
|
|
58
58
|
@Ignore("Remove to run test")
|
|
59
59
|
@Test
|
|
60
|
-
public void
|
|
60
|
+
public void testSumOfSquaresUpToHundred() {
|
|
61
61
|
final int expected = 338350;
|
|
62
62
|
final int actual = calculator.computeSumOfSquaresTo(100);
|
|
63
63
|
assertEquals(expected, actual);
|
|
@@ -65,7 +65,7 @@ public class DifferenceOfSquaresCalculatorTest {
|
|
|
65
65
|
|
|
66
66
|
@Ignore("Remove to run test")
|
|
67
67
|
@Test
|
|
68
|
-
public void
|
|
68
|
+
public void testDifferenceOfSquaresUpToOne() {
|
|
69
69
|
final int expected = 0;
|
|
70
70
|
final int actual = calculator.computeDifferenceOfSquares(1);
|
|
71
71
|
assertEquals(expected, actual);
|
|
@@ -73,7 +73,7 @@ public class DifferenceOfSquaresCalculatorTest {
|
|
|
73
73
|
|
|
74
74
|
@Ignore("Remove to run test")
|
|
75
75
|
@Test
|
|
76
|
-
public void
|
|
76
|
+
public void testDifferenceOfSquaresUpToFive() {
|
|
77
77
|
final int expected = 170;
|
|
78
78
|
final int actual = calculator.computeDifferenceOfSquares(5);
|
|
79
79
|
assertEquals(expected, actual);
|
|
@@ -81,7 +81,7 @@ public class DifferenceOfSquaresCalculatorTest {
|
|
|
81
81
|
|
|
82
82
|
@Ignore("Remove to run test")
|
|
83
83
|
@Test
|
|
84
|
-
public void
|
|
84
|
+
public void testDifferenceOfSquaresUpToHundred() {
|
|
85
85
|
final int expected = 25164150;
|
|
86
86
|
final int actual = calculator.computeDifferenceOfSquares(100);
|
|
87
87
|
assertEquals(expected, actual);
|
|
@@ -14,24 +14,30 @@ product: `91 * 99 = 9009`.
|
|
|
14
14
|
|
|
15
15
|
It's possible (and indeed common) for a palindrome product to be the product
|
|
16
16
|
of multiple combinations of numbers. For example, the palindrome product `9` has
|
|
17
|
-
the factors `(1, 9)
|
|
17
|
+
the factors `(1, 9)` and `(3, 3)`.
|
|
18
18
|
|
|
19
19
|
Write a program that given a range of integers, returns the smallest and largest
|
|
20
|
-
palindromic product within that range, along with all
|
|
20
|
+
palindromic product of factors within that range, along with all the factors in the range for that product.
|
|
21
21
|
|
|
22
22
|
## Example 1
|
|
23
23
|
|
|
24
24
|
Given the range `[1, 9]` (both inclusive)...
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
And given the list of all possible products within this range:
|
|
27
|
+
`[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 15, 21, 24, 27, 20, 28, 32, 36, 25, 30, 35, 40, 45, 42, 48, 54, 49, 56, 63, 64, 72, 81]`
|
|
28
|
+
|
|
29
|
+
The palindrome products are all single digit numbers (in this case):
|
|
30
|
+
`[1, 2, 3, 4, 5, 6, 7, 8, 9]`
|
|
31
|
+
|
|
32
|
+
The smallest palindrome product is `1`. Its factors are `(1, 1)`.
|
|
33
|
+
The largest palindrome product is `9`. Its factors are `(1, 9)` and `(3, 3)`.
|
|
28
34
|
|
|
29
35
|
## Example 2
|
|
30
36
|
|
|
31
37
|
Given the range `[10, 99]` (both inclusive)...
|
|
32
38
|
|
|
33
|
-
The smallest palindrome product is `121`.
|
|
34
|
-
The largest palindrome product is `9009`.
|
|
39
|
+
The smallest palindrome product is `121`. Its factors are `(11, 11)`.
|
|
40
|
+
The largest palindrome product is `9009`. Its factors are `(91, 99)`.
|
|
35
41
|
|
|
36
42
|
* * * *
|
|
37
43
|
|
|
@@ -2,7 +2,7 @@ require 'minitest/autorun'
|
|
|
2
2
|
require_relative '<%= exercise_name %>'
|
|
3
3
|
|
|
4
4
|
# Common test data version: <%= canonical_data_version %> <%= abbreviated_commit_hash %>
|
|
5
|
-
class <%=
|
|
5
|
+
class <%= exercise_test_classname %> < Minitest::Test
|
|
6
6
|
# assert_in_delta will pass if the difference
|
|
7
7
|
# between the values being compared is less
|
|
8
8
|
# than the allowed delta
|
|
@@ -2,7 +2,7 @@ require 'minitest/autorun'
|
|
|
2
2
|
require_relative '<%= exercise_name %>'
|
|
3
3
|
|
|
4
4
|
# Common test data version: <%= canonical_data_version %> <%= abbreviated_commit_hash %>
|
|
5
|
-
class <%=
|
|
5
|
+
class <%= exercise_test_classname %> < Minitest::Test
|
|
6
6
|
<% test_cases.each_with_index do |test_case, idx| %>
|
|
7
7
|
def <%= test_case.name %>
|
|
8
8
|
<%= test_case.skipped(idx) %>
|
|
@@ -26,10 +26,10 @@ module Generator
|
|
|
26
26
|
assert_equal expected_exercise_name, subject.exercise_name
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def
|
|
30
|
-
|
|
29
|
+
def test_exercise_test_classname
|
|
30
|
+
expected = 'AlphaBetaTest'
|
|
31
31
|
subject = TemplateValues.new(@arguments.merge(exercise_name: 'alpha_beta'))
|
|
32
|
-
assert_equal
|
|
32
|
+
assert_equal expected, subject.exercise_test_classname
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def test_test_cases
|
data/tracks/scala/config.json
CHANGED
|
@@ -1,260 +1,254 @@
|
|
|
1
|
-
import org.scalatest.{Matchers,
|
|
1
|
+
import org.scalatest.{Matchers, FunSuite}
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/** @version 1.0.1 */
|
|
4
|
+
class ClockTest extends FunSuite with Matchers {
|
|
5
|
+
|
|
6
|
+
test("on the hour") {
|
|
7
|
+
Clock(8, 0) should be (Clock(8, 0))
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
test("past the hour") {
|
|
10
11
|
pending
|
|
11
|
-
Clock(
|
|
12
|
+
Clock(11, 9) should be (Clock(11, 9))
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
test("midnight is zero hours") {
|
|
15
16
|
pending
|
|
16
|
-
Clock(
|
|
17
|
-
Clock(15, 37) should not be Clock(15, 36)
|
|
17
|
+
Clock(24, 0) should be (Clock(0, 0))
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
test("hour rolls over") {
|
|
21
21
|
pending
|
|
22
|
-
Clock(24, 0) should be (Clock(0, 0))
|
|
23
22
|
Clock(25, 0) should be (Clock(1, 0))
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
test("hour rolls over continuously") {
|
|
27
26
|
pending
|
|
28
27
|
Clock(100, 0) should be (Clock(4, 0))
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
test("sixty minutes is next hour") {
|
|
32
31
|
pending
|
|
33
32
|
Clock(1, 60) should be (Clock(2, 0))
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
pending
|
|
38
|
-
Clock(60) should be (Clock(1, 0))
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
it should "support rolling over minutes" in {
|
|
35
|
+
test("minutes roll over") {
|
|
42
36
|
pending
|
|
43
37
|
Clock(0, 160) should be (Clock(2, 40))
|
|
44
38
|
}
|
|
45
39
|
|
|
46
|
-
|
|
40
|
+
test("minutes roll over continuously") {
|
|
47
41
|
pending
|
|
48
42
|
Clock(0, 1723) should be (Clock(4, 43))
|
|
49
43
|
}
|
|
50
44
|
|
|
51
|
-
|
|
45
|
+
test("hour and minutes roll over") {
|
|
52
46
|
pending
|
|
53
47
|
Clock(25, 160) should be (Clock(3, 40))
|
|
54
48
|
}
|
|
55
49
|
|
|
56
|
-
|
|
50
|
+
test("hour and minutes roll over continuously") {
|
|
57
51
|
pending
|
|
58
52
|
Clock(201, 3001) should be (Clock(11, 1))
|
|
59
53
|
}
|
|
60
54
|
|
|
61
|
-
|
|
55
|
+
test("hour and minutes roll over to exactly midnight") {
|
|
62
56
|
pending
|
|
63
57
|
Clock(72, 8640) should be (Clock(0, 0))
|
|
64
58
|
}
|
|
65
59
|
|
|
66
|
-
|
|
60
|
+
test("negative hour") {
|
|
67
61
|
pending
|
|
68
62
|
Clock(-1, 15) should be (Clock(23, 15))
|
|
69
63
|
}
|
|
70
64
|
|
|
71
|
-
|
|
65
|
+
test("negative hour rolls over") {
|
|
72
66
|
pending
|
|
73
67
|
Clock(-25, 0) should be (Clock(23, 0))
|
|
74
68
|
}
|
|
75
69
|
|
|
76
|
-
|
|
70
|
+
test("negative hour rolls over continuously") {
|
|
77
71
|
pending
|
|
78
72
|
Clock(-91, 0) should be (Clock(5, 0))
|
|
79
73
|
}
|
|
80
74
|
|
|
81
|
-
|
|
75
|
+
test("negative minutes") {
|
|
82
76
|
pending
|
|
83
77
|
Clock(1, -40) should be (Clock(0, 20))
|
|
84
78
|
}
|
|
85
79
|
|
|
86
|
-
|
|
80
|
+
test("negative minutes roll over") {
|
|
87
81
|
pending
|
|
88
82
|
Clock(1, -160) should be (Clock(22, 20))
|
|
89
83
|
}
|
|
90
84
|
|
|
91
|
-
|
|
85
|
+
test("negative minutes roll over continuously") {
|
|
92
86
|
pending
|
|
93
87
|
Clock(1, -4820) should be (Clock(16, 40))
|
|
94
88
|
}
|
|
95
89
|
|
|
96
|
-
|
|
90
|
+
test("negative hour and minutes both roll over") {
|
|
97
91
|
pending
|
|
98
92
|
Clock(-25, -160) should be (Clock(20, 20))
|
|
99
93
|
}
|
|
100
94
|
|
|
101
|
-
|
|
95
|
+
test("negative hour and minutes both roll over continuously") {
|
|
102
96
|
pending
|
|
103
97
|
Clock(-121, -5810) should be (Clock(22, 10))
|
|
104
98
|
}
|
|
105
99
|
|
|
106
|
-
|
|
100
|
+
test("add minutes") {
|
|
107
101
|
pending
|
|
108
102
|
Clock(10, 0) + Clock(3) should be (Clock(10, 3))
|
|
109
103
|
}
|
|
110
104
|
|
|
111
|
-
|
|
105
|
+
test("add no minutes") {
|
|
112
106
|
pending
|
|
113
107
|
Clock(6, 41) + Clock(0) should be (Clock(6, 41))
|
|
114
108
|
}
|
|
115
109
|
|
|
116
|
-
|
|
110
|
+
test("add to next hour") {
|
|
117
111
|
pending
|
|
118
112
|
Clock(0, 45) + Clock(40) should be (Clock(1, 25))
|
|
119
113
|
}
|
|
120
114
|
|
|
121
|
-
|
|
115
|
+
test("add more than one hour") {
|
|
122
116
|
pending
|
|
123
117
|
Clock(10, 0) + Clock(61) should be (Clock(11, 1))
|
|
124
118
|
}
|
|
125
119
|
|
|
126
|
-
|
|
120
|
+
test("add more than two hours with carry") {
|
|
127
121
|
pending
|
|
128
122
|
Clock(0, 45) + Clock(160) should be (Clock(3, 25))
|
|
129
123
|
}
|
|
130
124
|
|
|
131
|
-
|
|
125
|
+
test("add across midnight") {
|
|
132
126
|
pending
|
|
133
127
|
Clock(23, 59) + Clock(2) should be (Clock(0, 1))
|
|
134
128
|
}
|
|
135
129
|
|
|
136
|
-
|
|
130
|
+
test("add more than one day (1500 min = 25 hrs)") {
|
|
137
131
|
pending
|
|
138
132
|
Clock(5, 32) + Clock(1500) should be (Clock(6, 32))
|
|
139
133
|
}
|
|
140
134
|
|
|
141
|
-
|
|
135
|
+
test("add more than two days") {
|
|
142
136
|
pending
|
|
143
137
|
Clock(1, 1) + Clock(3500) should be (Clock(11, 21))
|
|
144
138
|
}
|
|
145
139
|
|
|
146
|
-
|
|
140
|
+
test("subtract minutes") {
|
|
147
141
|
pending
|
|
148
142
|
Clock(10, 3) - Clock(3) should be (Clock(10, 0))
|
|
149
143
|
}
|
|
150
144
|
|
|
151
|
-
|
|
145
|
+
test("subtract to previous hour") {
|
|
152
146
|
pending
|
|
153
147
|
Clock(10, 3) - Clock(30) should be (Clock(9, 33))
|
|
154
148
|
}
|
|
155
149
|
|
|
156
|
-
|
|
150
|
+
test("subtract more than an hour") {
|
|
157
151
|
pending
|
|
158
152
|
Clock(10, 3) - Clock(70) should be (Clock(8, 53))
|
|
159
153
|
}
|
|
160
154
|
|
|
161
|
-
|
|
155
|
+
test("subtract across midnight") {
|
|
162
156
|
pending
|
|
163
157
|
Clock(0, 3) - Clock(4) should be (Clock(23, 59))
|
|
164
158
|
}
|
|
165
159
|
|
|
166
|
-
|
|
160
|
+
test("subtract more than two hours") {
|
|
167
161
|
pending
|
|
168
162
|
Clock(0, 0) - Clock(160) should be (Clock(21, 20))
|
|
169
163
|
}
|
|
170
164
|
|
|
171
|
-
|
|
165
|
+
test("subtract more than two hours with borrow") {
|
|
172
166
|
pending
|
|
173
167
|
Clock(6, 15) - Clock(160) should be (Clock(3, 35))
|
|
174
168
|
}
|
|
175
169
|
|
|
176
|
-
|
|
170
|
+
test("subtract more than one day (1500 min = 25 hrs)") {
|
|
177
171
|
pending
|
|
178
172
|
Clock(5, 32) - Clock(1500) should be (Clock(4, 32))
|
|
179
173
|
}
|
|
180
174
|
|
|
181
|
-
|
|
175
|
+
test("subtract more than two days") {
|
|
182
176
|
pending
|
|
183
177
|
Clock(2, 20) - Clock(3000) should be (Clock(0, 20))
|
|
184
178
|
}
|
|
185
179
|
|
|
186
|
-
|
|
180
|
+
test("clocks with same time") {
|
|
187
181
|
pending
|
|
188
|
-
Clock(15, 37)
|
|
182
|
+
Clock(15, 37) == Clock(15, 37) should be (true)
|
|
189
183
|
}
|
|
190
184
|
|
|
191
|
-
|
|
185
|
+
test("clocks a minute apart") {
|
|
192
186
|
pending
|
|
193
|
-
Clock(15, 36)
|
|
187
|
+
Clock(15, 36) == Clock(15, 37) should be (false)
|
|
194
188
|
}
|
|
195
189
|
|
|
196
|
-
|
|
190
|
+
test("clocks an hour apart") {
|
|
197
191
|
pending
|
|
198
|
-
Clock(14, 37)
|
|
192
|
+
Clock(14, 37) == Clock(15, 37) should be (false)
|
|
199
193
|
}
|
|
200
194
|
|
|
201
|
-
|
|
195
|
+
test("clocks with hour overflow") {
|
|
202
196
|
pending
|
|
203
|
-
Clock(10, 37)
|
|
197
|
+
Clock(10, 37) == Clock(34, 37) should be (true)
|
|
204
198
|
}
|
|
205
199
|
|
|
206
|
-
|
|
200
|
+
test("clocks with hour overflow by several days") {
|
|
207
201
|
pending
|
|
208
|
-
Clock(3, 11)
|
|
202
|
+
Clock(3, 11) == Clock(99, 11) should be (true)
|
|
209
203
|
}
|
|
210
204
|
|
|
211
|
-
|
|
205
|
+
test("clocks with negative hour") {
|
|
212
206
|
pending
|
|
213
|
-
Clock(22, 40)
|
|
207
|
+
Clock(22, 40) == Clock(-2, 40) should be (true)
|
|
214
208
|
}
|
|
215
209
|
|
|
216
|
-
|
|
210
|
+
test("clocks with negative hour that wraps") {
|
|
217
211
|
pending
|
|
218
|
-
Clock(17, 3)
|
|
212
|
+
Clock(17, 3) == Clock(-31, 3) should be (true)
|
|
219
213
|
}
|
|
220
214
|
|
|
221
|
-
|
|
215
|
+
test("clocks with negative hour that wraps multiple times") {
|
|
222
216
|
pending
|
|
223
|
-
Clock(13, 49)
|
|
217
|
+
Clock(13, 49) == Clock(-83, 49) should be (true)
|
|
224
218
|
}
|
|
225
219
|
|
|
226
|
-
|
|
220
|
+
test("clocks with minute overflow") {
|
|
227
221
|
pending
|
|
228
|
-
Clock(0, 1)
|
|
222
|
+
Clock(0, 1) == Clock(0, 1441) should be (true)
|
|
229
223
|
}
|
|
230
224
|
|
|
231
|
-
|
|
225
|
+
test("clocks with minute overflow by several days") {
|
|
232
226
|
pending
|
|
233
|
-
Clock(2, 2)
|
|
227
|
+
Clock(2, 2) == Clock(2, 4322) should be (true)
|
|
234
228
|
}
|
|
235
229
|
|
|
236
|
-
|
|
230
|
+
test("clocks with negative minute") {
|
|
237
231
|
pending
|
|
238
|
-
Clock(2, 40)
|
|
232
|
+
Clock(2, 40) == Clock(3, -20) should be (true)
|
|
239
233
|
}
|
|
240
234
|
|
|
241
|
-
|
|
235
|
+
test("clocks with negative minute that wraps") {
|
|
242
236
|
pending
|
|
243
|
-
Clock(4, 10)
|
|
237
|
+
Clock(4, 10) == Clock(5, -1490) should be (true)
|
|
244
238
|
}
|
|
245
239
|
|
|
246
|
-
|
|
240
|
+
test("clocks with negative minute that wraps multiple times") {
|
|
247
241
|
pending
|
|
248
|
-
Clock(6, 15)
|
|
242
|
+
Clock(6, 15) == Clock(6, -4305) should be (true)
|
|
249
243
|
}
|
|
250
244
|
|
|
251
|
-
|
|
245
|
+
test("clocks with negative hours and minutes") {
|
|
252
246
|
pending
|
|
253
|
-
Clock(7, 32)
|
|
247
|
+
Clock(7, 32) == Clock(-12, -268) should be (true)
|
|
254
248
|
}
|
|
255
249
|
|
|
256
|
-
|
|
250
|
+
test("clocks with negative hours and minutes that wrap") {
|
|
257
251
|
pending
|
|
258
|
-
Clock(18, 7)
|
|
252
|
+
Clock(18, 7) == Clock(-54, -11513) should be (true)
|
|
259
253
|
}
|
|
260
|
-
}
|
|
254
|
+
}
|