trackler 2.0.8.12 → 2.0.8.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/exercises/hamming/canonical-data.json +121 -104
- data/lib/trackler/version.rb +1 -1
- data/tracks/delphi/.gitignore +40 -2
- data/tracks/delphi/config.json +8 -0
- data/tracks/delphi/exercises/allergies/{AllergyTests.dpr → Allergies.dpr} +1 -1
- data/tracks/delphi/exercises/allergies/uAllergyTests.pas +1 -1
- data/tracks/delphi/exercises/bank-account/{BankAccountTests.dpr → BankAccount.dpr} +1 -1
- data/tracks/delphi/exercises/bank-account/uBankAccountTests.pas +1 -1
- data/tracks/delphi/exercises/beer-song/{BeerSongTests.dpr → BeerSong.dpr} +1 -1
- data/tracks/delphi/exercises/beer-song/uBeerSongTests.pas +7 -6
- data/tracks/delphi/exercises/binary-search/{BinarySearchTest.dpr → BinarySearch.dpr} +1 -1
- data/tracks/delphi/exercises/binary-search/uBinarySearchTest.pas +9 -8
- data/tracks/delphi/exercises/bob/uBobTests.pas +18 -17
- data/tracks/delphi/exercises/book-store/{BookStoreTests.dpr → BookStore.dpr} +1 -1
- data/tracks/delphi/exercises/book-store/uBookStoreTests.pas +12 -11
- data/tracks/delphi/exercises/bowling/{BowlingTests.dpr → Bowling.dpr} +1 -1
- data/tracks/delphi/exercises/bowling/uBowlingTests.pas +24 -23
- data/tracks/delphi/exercises/circular-buffer/{CircularBufferTests.dpr → CircularBuffer.dpr} +1 -1
- data/tracks/delphi/exercises/circular-buffer/uCircularBufferTests.pas +1 -1
- data/tracks/delphi/exercises/clock/{ClockTest.dpr → Clock.dpr} +1 -1
- data/tracks/delphi/exercises/clock/uClockTest.pas +13 -5
- data/tracks/delphi/exercises/etl/{ETLtests.dpr → ETL.dpr} +1 -1
- data/tracks/delphi/exercises/etl/uETLtests.pas +1 -1
- data/tracks/delphi/exercises/grains/{GrainsTests.dpr → Grains.dpr} +1 -1
- data/tracks/delphi/exercises/grains/uGrainsTests.pas +11 -10
- data/tracks/delphi/exercises/hamming/uHammingTests.pas +1 -0
- data/tracks/delphi/exercises/leap/{LeapTest.dpr → Leap.dpr} +1 -1
- data/tracks/delphi/exercises/leap/uLeapTests.pas +1 -0
- data/tracks/delphi/exercises/nucleotide-count/{NucleotideCountTest.dpr → NucleotideCount.dpr} +1 -1
- data/tracks/delphi/exercises/nucleotide-count/uNucleotideCountTest.pas +9 -8
- data/tracks/delphi/exercises/perfect-numbers/{PerfectNumbersTest.dpr → PerfectNumbers.dpr} +1 -1
- data/tracks/delphi/exercises/perfect-numbers/uPerfectNumbersTest.pas +71 -20
- data/tracks/delphi/exercises/phone-number/{PhoneNumberTests.dpr → PhoneNumber.dpr} +1 -1
- data/tracks/delphi/exercises/phone-number/uPhoneNumberTests.pas +1 -0
- data/tracks/delphi/exercises/poker/uPokerTest.pas +1 -0
- data/tracks/delphi/exercises/raindrops/raindrops.dpr +60 -0
- data/tracks/delphi/exercises/raindrops/uRaindropsExample.pas +27 -0
- data/tracks/delphi/exercises/raindrops/uRaindropsTest.pas +180 -0
- data/tracks/delphi/exercises/rna-transcription/{TestRnaTranscription.dpr → RnaTranscription.dpr} +1 -1
- data/tracks/delphi/exercises/rna-transcription/uTestRnaTranscription.pas +8 -7
- data/tracks/delphi/exercises/saddle-points/{TestSaddlePoints.dpr → SaddlePoints.dpr} +1 -1
- data/tracks/delphi/exercises/saddle-points/uSaddlePointsTests.pas +6 -5
- data/tracks/go/config.json +12 -4
- data/tracks/go/exercises/accumulate/accumulate_test.go +2 -4
- data/tracks/go/exercises/luhn/cases_test.go +76 -0
- data/tracks/go/exercises/luhn/example.go +26 -26
- data/tracks/go/exercises/luhn/example_gen.go +50 -0
- data/tracks/go/exercises/luhn/luhn_test.go +1 -14
- data/tracks/go/exercises/perfect-numbers/perfect_numbers_test.go +14 -13
- data/tracks/java/exercises/rna-transcription/src/example/java/RnaTranscription.java +1 -1
- data/tracks/java/exercises/rna-transcription/src/main/java/RnaTranscription.java +5 -0
- data/tracks/java/exercises/rna-transcription/src/test/java/RnaTranscriptionTest.java +14 -7
- data/tracks/julia/.travis.yml +1 -0
- data/tracks/lisp/docs/ABOUT.md +10 -7
- data/tracks/lisp/docs/INSTALLATION.md +12 -4
- data/tracks/lisp/docs/LEARNING.md +11 -5
- data/tracks/lisp/docs/RESOURCES.md +18 -9
- data/tracks/lisp/docs/TESTS.md +4 -0
- data/tracks/scala/exercises/simple-linked-list/src/test/scala/SimpleLinkedListTest.scala +9 -1
- data/tracks/typescript/config.json +6 -0
- data/tracks/typescript/exercises/food-chain/food-chain.example.ts +54 -0
- data/tracks/typescript/exercises/food-chain/food-chain.test.ts +163 -0
- data/tracks/typescript/exercises/food-chain/package.json +37 -0
- data/tracks/typescript/exercises/food-chain/tsconfig.json +21 -0
- data/tracks/typescript/exercises/food-chain/tslint.json +127 -0
- data/tracks/typescript/exercises/food-chain/yarn.lock +2697 -0
- metadata +30 -19
- data/tracks/java/exercises/rna-transcription/src/main/java/.keep +0 -0
@@ -9,50 +9,51 @@ type
|
|
9
9
|
hpTests = class(TObject)
|
10
10
|
public
|
11
11
|
[Test]
|
12
|
+
// [Ignore('Comment the "[Ignore]" statement to run the test')]
|
12
13
|
procedure A_basket_containing_only_a_single_book;
|
13
14
|
|
14
15
|
[Test]
|
15
|
-
[Ignore
|
16
|
+
[Ignore]
|
16
17
|
procedure A_basket_containing_only_two_of_the_same_book;
|
17
18
|
|
18
19
|
[Test]
|
19
|
-
[Ignore
|
20
|
+
[Ignore]
|
20
21
|
procedure No_charge_to_carry_around_an_empty_basket;
|
21
22
|
|
22
23
|
[Test]
|
23
|
-
[Ignore
|
24
|
+
[Ignore]
|
24
25
|
procedure A_basket_containing_only_two_different_books;
|
25
26
|
|
26
27
|
[Test]
|
27
|
-
[Ignore
|
28
|
+
[Ignore]
|
28
29
|
procedure A_basket_with_three_different_books;
|
29
30
|
|
30
31
|
[Test]
|
31
|
-
[Ignore
|
32
|
+
[Ignore]
|
32
33
|
procedure A_basket_with_four_different_books;
|
33
34
|
|
34
35
|
[Test]
|
35
|
-
[Ignore
|
36
|
+
[Ignore]
|
36
37
|
procedure A_basket_with_five_different_books;
|
37
38
|
|
38
39
|
[Test]
|
39
|
-
[Ignore
|
40
|
+
[Ignore]
|
40
41
|
procedure A_basket_containing_eight_books_consisting_of_a_pair_each_of_the_first_three_books_plus_one_copy_each_of_the_last_two_books;
|
41
42
|
|
42
43
|
[Test]
|
43
|
-
[Ignore
|
44
|
+
[Ignore]
|
44
45
|
procedure A_basket_containing_nine_books_consisting_of_a_pair_each_of_the_first_four_books_plus_one_of_the_last_book;
|
45
46
|
|
46
47
|
[Test]
|
47
|
-
[Ignore
|
48
|
+
[Ignore]
|
48
49
|
procedure A_basket_containing_ten_books_consisting_of_two_copies_of_each_book_in_the_series;
|
49
50
|
|
50
51
|
[Test]
|
51
|
-
[Ignore
|
52
|
+
[Ignore]
|
52
53
|
procedure A_basket_containing_eleven_books_consisting_of_three_copies_of_the_first_book_plus_two_each_of_the_remaing_four_bookes_in_the_series;
|
53
54
|
|
54
55
|
[Test]
|
55
|
-
[Ignore
|
56
|
+
[Ignore]
|
56
57
|
procedure A_basket_containing_twelve_books_consisting_of_three_copies_of_the_first_two_books_plus_two_each_of_the_remaining_three_books_in_the_series;
|
57
58
|
end;
|
58
59
|
|
@@ -13,98 +13,99 @@ type
|
|
13
13
|
class function RollMany(pins: array of integer; game: IBowlingGame): IBowlingGame; static;
|
14
14
|
public
|
15
15
|
[Test]
|
16
|
+
// [Ignore('Comment the "[Ignore]" statement to run the test')]
|
16
17
|
procedure Should_be_able_to_score_a_game_with_all_zeros;
|
17
18
|
|
18
19
|
[Test]
|
19
|
-
[Ignore
|
20
|
+
[Ignore]
|
20
21
|
procedure Should_be_able_to_score_a_game_with_no_strikes_or_spares;
|
21
22
|
|
22
23
|
[Test]
|
23
|
-
[Ignore
|
24
|
+
[Ignore]
|
24
25
|
procedure A_spare_followed_by_zeros_is_worth_ten_points;
|
25
26
|
|
26
27
|
[Test]
|
27
|
-
[Ignore
|
28
|
+
[Ignore]
|
28
29
|
procedure Points_scored_in_the_roll_after_a_spare_are_counted_twice;
|
29
30
|
|
30
31
|
[Test]
|
31
|
-
[Ignore
|
32
|
+
[Ignore]
|
32
33
|
procedure Consecutive_spares_each_get_a_one_roll_bonus;
|
33
34
|
|
34
35
|
[Test]
|
35
|
-
[Ignore
|
36
|
+
[Ignore]
|
36
37
|
procedure A_spare_in_the_last_frame_gets_a_one_roll_bonus_that_is_counted_once;
|
37
38
|
|
38
39
|
[Test]
|
39
|
-
[Ignore
|
40
|
+
[Ignore]
|
40
41
|
procedure A_strike_earns_ten_points_in_frame_with_a_single_roll;
|
41
42
|
|
42
43
|
[Test]
|
43
|
-
[Ignore
|
44
|
+
[Ignore]
|
44
45
|
procedure Points_scored_in_the_two_rolls_after_a_strike_are_counted_twice_as_a_bonus;
|
45
46
|
|
46
47
|
[Test]
|
47
|
-
[Ignore
|
48
|
+
[Ignore]
|
48
49
|
procedure Consecutive_strikes_each_get_the_two_roll_bonus;
|
49
50
|
|
50
51
|
[Test]
|
51
|
-
[Ignore
|
52
|
+
[Ignore]
|
52
53
|
procedure A_strike_in_the_last_frame_gets_a_two_roll_bonus_that_is_counted_once;
|
53
54
|
|
54
55
|
[Test]
|
55
|
-
[Ignore
|
56
|
+
[Ignore]
|
56
57
|
procedure Rolling_a_spare_with_the_two_roll_bonus_does_not_get_a_bonus_roll;
|
57
58
|
|
58
59
|
[Test]
|
59
|
-
[Ignore
|
60
|
+
[Ignore]
|
60
61
|
procedure Strikes_with_the_two_roll_bonus_do_not_get_bonus_rolls;
|
61
62
|
|
62
63
|
[Test]
|
63
|
-
[Ignore
|
64
|
+
[Ignore]
|
64
65
|
procedure A_strike_with_the_one_roll_bonus_after_a_spare_in_the_last_frame_does_not_get_a_bonus;
|
65
66
|
|
66
67
|
[Test]
|
67
|
-
[Ignore
|
68
|
+
[Ignore]
|
68
69
|
procedure All_strikes_is_a_perfect_game;
|
69
70
|
|
70
71
|
[Test]
|
71
|
-
[Ignore
|
72
|
+
[Ignore]
|
72
73
|
procedure Rolls_can_not_score_negative_points;
|
73
74
|
|
74
75
|
[Test]
|
75
|
-
[Ignore
|
76
|
+
[Ignore]
|
76
77
|
procedure A_roll_can_not_score_more_than_10_points;
|
77
78
|
|
78
79
|
[Test]
|
79
|
-
[Ignore
|
80
|
+
[Ignore]
|
80
81
|
procedure Two_rolls_in_a_frame_can_not_score_more_than_10_points;
|
81
82
|
|
82
83
|
[Test]
|
83
|
-
[Ignore
|
84
|
+
[Ignore]
|
84
85
|
procedure Two_bonus_rolls_after_a_strike_in_the_last_frame_can_not_score_more_than_10_points;
|
85
86
|
|
86
87
|
[Test]
|
87
|
-
[Ignore
|
88
|
+
[Ignore]
|
88
89
|
procedure An_unstarted_game_can_not_be_scored;
|
89
90
|
|
90
91
|
[Test]
|
91
|
-
[Ignore
|
92
|
+
[Ignore]
|
92
93
|
procedure An_incomplete_game_can_not_be_scored;
|
93
94
|
|
94
95
|
[Test]
|
95
|
-
[Ignore
|
96
|
+
[Ignore]
|
96
97
|
procedure A_game_with_more_than_ten_frames_can_not_be_scored;
|
97
98
|
|
98
99
|
[Test]
|
99
|
-
[Ignore
|
100
|
+
[Ignore]
|
100
101
|
procedure Bonus_rolls_for_a_strike_in_the_last_frame_must_be_rolled_before_score_can_be_calculated;
|
101
102
|
|
102
103
|
[Test]
|
103
|
-
[Ignore
|
104
|
+
[Ignore]
|
104
105
|
procedure Both_bonus_rolls_for_a_strike_in_the_last_frame_must_be_rolled_before_score_can_be_calculated;
|
105
106
|
|
106
107
|
[Test]
|
107
|
-
[Ignore
|
108
|
+
[Ignore]
|
108
109
|
procedure Bonus_roll_for_a_spare_in_the_last_frame_must_be_rolled_before_score_can_be_calculated;
|
109
110
|
end;
|
110
111
|
|
@@ -10,9 +10,12 @@ type
|
|
10
10
|
TClockTest = class(TObject)
|
11
11
|
public
|
12
12
|
[Test]
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
// [Ignore('Comment the "[Ignore]" statement to run the test')]
|
14
|
+
procedure Prints_the_hour_8;
|
15
|
+
|
16
|
+
[Test]
|
17
|
+
[Ignore]
|
18
|
+
procedure Prints_the_hour_9;
|
16
19
|
|
17
20
|
[Test]
|
18
21
|
[Ignore]
|
@@ -70,9 +73,14 @@ type
|
|
70
73
|
implementation
|
71
74
|
uses uClock;
|
72
75
|
|
73
|
-
procedure TClockTest.
|
76
|
+
procedure TClockTest.Prints_the_hour_8;
|
77
|
+
begin
|
78
|
+
Assert.AreEqual('08:00', Clock.SetHands(8).ToString);
|
79
|
+
end;
|
80
|
+
|
81
|
+
procedure TClockTest.Prints_the_hour_9;
|
74
82
|
begin
|
75
|
-
Assert.AreEqual(
|
83
|
+
Assert.AreEqual('09:00', Clock.SetHands(9).ToString);
|
76
84
|
end;
|
77
85
|
|
78
86
|
procedure TClockTest.Can_add_minutes;
|
@@ -9,46 +9,47 @@ type
|
|
9
9
|
TgrainsTests = class(TObject)
|
10
10
|
public
|
11
11
|
[Test]
|
12
|
+
// [Ignore('Comment the "[Ignore]" statement to run the test')]
|
12
13
|
procedure Test_square_1;
|
13
14
|
|
14
15
|
[Test]
|
15
|
-
[Ignore
|
16
|
+
[Ignore]
|
16
17
|
procedure Test_square_2;
|
17
18
|
|
18
19
|
[Test]
|
19
|
-
[Ignore
|
20
|
+
[Ignore]
|
20
21
|
procedure Test_square_3;
|
21
22
|
|
22
23
|
[Test]
|
23
|
-
[Ignore
|
24
|
+
[Ignore]
|
24
25
|
procedure Test_square_4;
|
25
26
|
|
26
27
|
[Test]
|
27
|
-
[Ignore
|
28
|
+
[Ignore]
|
28
29
|
procedure Test_square_16;
|
29
30
|
|
30
31
|
[Test]
|
31
|
-
[Ignore
|
32
|
+
[Ignore]
|
32
33
|
procedure Test_square_32;
|
33
34
|
|
34
35
|
[Test]
|
35
|
-
[Ignore
|
36
|
+
[Ignore]
|
36
37
|
procedure Test_square_64;
|
37
38
|
|
38
39
|
[Test]
|
39
|
-
[Ignore
|
40
|
+
[Ignore]
|
40
41
|
procedure Square_0_raises_an_exception;
|
41
42
|
|
42
43
|
[Test]
|
43
|
-
[Ignore
|
44
|
+
[Ignore]
|
44
45
|
procedure Negative_square_raises_an_exception;
|
45
46
|
|
46
47
|
[Test]
|
47
|
-
[Ignore
|
48
|
+
[Ignore]
|
48
49
|
procedure Square_greater_than_64_raises_an_exception;
|
49
50
|
|
50
51
|
[Test]
|
51
|
-
[Ignore
|
52
|
+
[Ignore]
|
52
53
|
procedure Test_total_grains;
|
53
54
|
end;
|
54
55
|
|
@@ -2,7 +2,7 @@ unit uNucleotideCountTest;
|
|
2
2
|
|
3
3
|
interface
|
4
4
|
uses
|
5
|
-
DUnitX.TestFramework,
|
5
|
+
DUnitX.TestFramework, System.Generics.Collections;
|
6
6
|
|
7
7
|
type
|
8
8
|
|
@@ -15,34 +15,35 @@ type
|
|
15
15
|
procedure Validate_CompareDictionaries;
|
16
16
|
|
17
17
|
[Test]
|
18
|
+
// [Ignore('Comment the "[Ignore]" statement to run the test')]
|
18
19
|
procedure Has_no_nucleotides;
|
19
20
|
|
20
21
|
[Test]
|
21
|
-
[Ignore
|
22
|
+
[Ignore]
|
22
23
|
procedure Has_no_adenosine;
|
23
24
|
|
24
25
|
[Test]
|
25
|
-
[Ignore
|
26
|
+
[Ignore]
|
26
27
|
procedure Repetitive_cytidine_gets_counts;
|
27
28
|
|
28
29
|
[Test]
|
29
|
-
[Ignore
|
30
|
+
[Ignore]
|
30
31
|
procedure Repetitive_sequence_has_only_guanosine;
|
31
32
|
|
32
33
|
[Test]
|
33
|
-
[Ignore
|
34
|
+
[Ignore]
|
34
35
|
procedure Counts_only_thymidine;
|
35
36
|
|
36
37
|
[Test]
|
37
|
-
[Ignore
|
38
|
+
[Ignore]
|
38
39
|
procedure Counts_a_nucleotide_only_once;
|
39
40
|
|
40
41
|
[Test]
|
41
|
-
[Ignore
|
42
|
+
[Ignore]
|
42
43
|
procedure Validates_nucleotides;
|
43
44
|
|
44
45
|
[Test]
|
45
|
-
[Ignore
|
46
|
+
[Ignore]
|
46
47
|
procedure Counts_all_nucleotides;
|
47
48
|
end;
|
48
49
|
|
@@ -9,38 +9,89 @@ type
|
|
9
9
|
[TestFixture]
|
10
10
|
PerfectNumbersTest = class(TObject)
|
11
11
|
public
|
12
|
-
[
|
13
|
-
//
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
12
|
+
[Test]
|
13
|
+
// [Ignore('Comment the "[Ignore]" statement to run the test')]
|
14
|
+
procedure Can_classify_3_as_deficient;
|
15
|
+
|
16
|
+
[Test]
|
17
|
+
[Ignore]
|
18
|
+
procedure Can_classify_7_as_deficient;
|
19
|
+
|
20
|
+
[Test]
|
21
|
+
[Ignore]
|
22
|
+
procedure Can_classify_13_as_deficient;
|
23
|
+
|
24
|
+
[Test]
|
25
|
+
[Ignore]
|
26
|
+
procedure Can_classify_6_as_perfect;
|
27
|
+
|
28
|
+
[Test]
|
29
|
+
[Ignore]
|
30
|
+
procedure Can_classify_28_as_perfect;
|
31
|
+
|
32
|
+
[Test]
|
33
|
+
[Ignore]
|
34
|
+
procedure Can_classify_496_as_perfect;
|
35
|
+
|
36
|
+
[Test]
|
37
|
+
[Ignore]
|
38
|
+
procedure Can_classify_12_as_abundant;
|
39
|
+
|
40
|
+
[Test]
|
41
|
+
[Ignore]
|
42
|
+
procedure Can_classify_18_as_abundant;
|
43
|
+
|
44
|
+
[Test]
|
45
|
+
[Ignore]
|
46
|
+
procedure Can_classify_20_as_abundant;
|
26
47
|
end;
|
27
48
|
|
28
49
|
implementation
|
29
50
|
uses uPerfectNumbers;
|
30
51
|
|
31
|
-
procedure PerfectNumbersTest.
|
52
|
+
procedure PerfectNumbersTest.Can_classify_3_as_deficient;
|
53
|
+
begin
|
54
|
+
Assert.AreEqual(Deficient, PerfectNumber.Classify(3));
|
55
|
+
end;
|
56
|
+
|
57
|
+
procedure PerfectNumbersTest.Can_classify_7_as_deficient;
|
58
|
+
begin
|
59
|
+
Assert.AreEqual(Deficient, PerfectNumber.Classify(7));
|
60
|
+
end;
|
61
|
+
|
62
|
+
procedure PerfectNumbersTest.Can_classify_13_as_deficient;
|
63
|
+
begin
|
64
|
+
Assert.AreEqual(Deficient, PerfectNumber.Classify(13));
|
65
|
+
end;
|
66
|
+
|
67
|
+
procedure PerfectNumbersTest.Can_classify_6_as_perfect;
|
68
|
+
begin
|
69
|
+
Assert.AreEqual(Perfect, PerfectNumber.Classify(6));
|
70
|
+
end;
|
71
|
+
|
72
|
+
procedure PerfectNumbersTest.Can_classify_28_as_perfect;
|
73
|
+
begin
|
74
|
+
Assert.AreEqual(Perfect, PerfectNumber.Classify(28));
|
75
|
+
end;
|
76
|
+
|
77
|
+
procedure PerfectNumbersTest.Can_classify_496_as_perfect;
|
78
|
+
begin
|
79
|
+
Assert.AreEqual(Perfect, PerfectNumber.Classify(496));
|
80
|
+
end;
|
81
|
+
|
82
|
+
procedure PerfectNumbersTest.Can_classify_12_as_abundant;
|
32
83
|
begin
|
33
|
-
Assert.AreEqual(
|
84
|
+
Assert.AreEqual(Abundant, PerfectNumber.Classify(12));
|
34
85
|
end;
|
35
86
|
|
36
|
-
procedure PerfectNumbersTest.
|
87
|
+
procedure PerfectNumbersTest.Can_classify_18_as_abundant;
|
37
88
|
begin
|
38
|
-
Assert.AreEqual(
|
89
|
+
Assert.AreEqual(Abundant, PerfectNumber.Classify(18));
|
39
90
|
end;
|
40
91
|
|
41
|
-
procedure PerfectNumbersTest.
|
92
|
+
procedure PerfectNumbersTest.Can_classify_20_as_abundant;
|
42
93
|
begin
|
43
|
-
Assert.AreEqual(Abundant, PerfectNumber.Classify(
|
94
|
+
Assert.AreEqual(Abundant, PerfectNumber.Classify(20));
|
44
95
|
end;
|
45
96
|
|
46
97
|
initialization
|