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.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/common/exercises/hamming/canonical-data.json +121 -104
  3. data/lib/trackler/version.rb +1 -1
  4. data/tracks/delphi/.gitignore +40 -2
  5. data/tracks/delphi/config.json +8 -0
  6. data/tracks/delphi/exercises/allergies/{AllergyTests.dpr → Allergies.dpr} +1 -1
  7. data/tracks/delphi/exercises/allergies/uAllergyTests.pas +1 -1
  8. data/tracks/delphi/exercises/bank-account/{BankAccountTests.dpr → BankAccount.dpr} +1 -1
  9. data/tracks/delphi/exercises/bank-account/uBankAccountTests.pas +1 -1
  10. data/tracks/delphi/exercises/beer-song/{BeerSongTests.dpr → BeerSong.dpr} +1 -1
  11. data/tracks/delphi/exercises/beer-song/uBeerSongTests.pas +7 -6
  12. data/tracks/delphi/exercises/binary-search/{BinarySearchTest.dpr → BinarySearch.dpr} +1 -1
  13. data/tracks/delphi/exercises/binary-search/uBinarySearchTest.pas +9 -8
  14. data/tracks/delphi/exercises/bob/uBobTests.pas +18 -17
  15. data/tracks/delphi/exercises/book-store/{BookStoreTests.dpr → BookStore.dpr} +1 -1
  16. data/tracks/delphi/exercises/book-store/uBookStoreTests.pas +12 -11
  17. data/tracks/delphi/exercises/bowling/{BowlingTests.dpr → Bowling.dpr} +1 -1
  18. data/tracks/delphi/exercises/bowling/uBowlingTests.pas +24 -23
  19. data/tracks/delphi/exercises/circular-buffer/{CircularBufferTests.dpr → CircularBuffer.dpr} +1 -1
  20. data/tracks/delphi/exercises/circular-buffer/uCircularBufferTests.pas +1 -1
  21. data/tracks/delphi/exercises/clock/{ClockTest.dpr → Clock.dpr} +1 -1
  22. data/tracks/delphi/exercises/clock/uClockTest.pas +13 -5
  23. data/tracks/delphi/exercises/etl/{ETLtests.dpr → ETL.dpr} +1 -1
  24. data/tracks/delphi/exercises/etl/uETLtests.pas +1 -1
  25. data/tracks/delphi/exercises/grains/{GrainsTests.dpr → Grains.dpr} +1 -1
  26. data/tracks/delphi/exercises/grains/uGrainsTests.pas +11 -10
  27. data/tracks/delphi/exercises/hamming/uHammingTests.pas +1 -0
  28. data/tracks/delphi/exercises/leap/{LeapTest.dpr → Leap.dpr} +1 -1
  29. data/tracks/delphi/exercises/leap/uLeapTests.pas +1 -0
  30. data/tracks/delphi/exercises/nucleotide-count/{NucleotideCountTest.dpr → NucleotideCount.dpr} +1 -1
  31. data/tracks/delphi/exercises/nucleotide-count/uNucleotideCountTest.pas +9 -8
  32. data/tracks/delphi/exercises/perfect-numbers/{PerfectNumbersTest.dpr → PerfectNumbers.dpr} +1 -1
  33. data/tracks/delphi/exercises/perfect-numbers/uPerfectNumbersTest.pas +71 -20
  34. data/tracks/delphi/exercises/phone-number/{PhoneNumberTests.dpr → PhoneNumber.dpr} +1 -1
  35. data/tracks/delphi/exercises/phone-number/uPhoneNumberTests.pas +1 -0
  36. data/tracks/delphi/exercises/poker/uPokerTest.pas +1 -0
  37. data/tracks/delphi/exercises/raindrops/raindrops.dpr +60 -0
  38. data/tracks/delphi/exercises/raindrops/uRaindropsExample.pas +27 -0
  39. data/tracks/delphi/exercises/raindrops/uRaindropsTest.pas +180 -0
  40. data/tracks/delphi/exercises/rna-transcription/{TestRnaTranscription.dpr → RnaTranscription.dpr} +1 -1
  41. data/tracks/delphi/exercises/rna-transcription/uTestRnaTranscription.pas +8 -7
  42. data/tracks/delphi/exercises/saddle-points/{TestSaddlePoints.dpr → SaddlePoints.dpr} +1 -1
  43. data/tracks/delphi/exercises/saddle-points/uSaddlePointsTests.pas +6 -5
  44. data/tracks/go/config.json +12 -4
  45. data/tracks/go/exercises/accumulate/accumulate_test.go +2 -4
  46. data/tracks/go/exercises/luhn/cases_test.go +76 -0
  47. data/tracks/go/exercises/luhn/example.go +26 -26
  48. data/tracks/go/exercises/luhn/example_gen.go +50 -0
  49. data/tracks/go/exercises/luhn/luhn_test.go +1 -14
  50. data/tracks/go/exercises/perfect-numbers/perfect_numbers_test.go +14 -13
  51. data/tracks/java/exercises/rna-transcription/src/example/java/RnaTranscription.java +1 -1
  52. data/tracks/java/exercises/rna-transcription/src/main/java/RnaTranscription.java +5 -0
  53. data/tracks/java/exercises/rna-transcription/src/test/java/RnaTranscriptionTest.java +14 -7
  54. data/tracks/julia/.travis.yml +1 -0
  55. data/tracks/lisp/docs/ABOUT.md +10 -7
  56. data/tracks/lisp/docs/INSTALLATION.md +12 -4
  57. data/tracks/lisp/docs/LEARNING.md +11 -5
  58. data/tracks/lisp/docs/RESOURCES.md +18 -9
  59. data/tracks/lisp/docs/TESTS.md +4 -0
  60. data/tracks/scala/exercises/simple-linked-list/src/test/scala/SimpleLinkedListTest.scala +9 -1
  61. data/tracks/typescript/config.json +6 -0
  62. data/tracks/typescript/exercises/food-chain/food-chain.example.ts +54 -0
  63. data/tracks/typescript/exercises/food-chain/food-chain.test.ts +163 -0
  64. data/tracks/typescript/exercises/food-chain/package.json +37 -0
  65. data/tracks/typescript/exercises/food-chain/tsconfig.json +21 -0
  66. data/tracks/typescript/exercises/food-chain/tslint.json +127 -0
  67. data/tracks/typescript/exercises/food-chain/yarn.lock +2697 -0
  68. metadata +30 -19
  69. data/tracks/java/exercises/rna-transcription/src/main/java/.keep +0 -0
@@ -1,4 +1,4 @@
1
- program PhoneNumberTests;
1
+ program PhoneNumber;
2
2
 
3
3
  {$IFNDEF TESTINSIGHT}
4
4
  {$APPTYPE CONSOLE}
@@ -16,6 +16,7 @@ type
16
16
  PhoneNumberTests = class(TObject)
17
17
  public
18
18
  [Test]
19
+ // [Ignore('Comment the "[Ignore]" statement to run the test')]
19
20
  procedure Cleans_parens_spaces_and_dashes;
20
21
 
21
22
  [Test]
@@ -10,6 +10,7 @@ type
10
10
  PokerTest = class(TObject)
11
11
  public
12
12
  [Test]
13
+ // [Ignore('Comment the "[Ignore]" statement to run the test')]
13
14
  procedure One_hand;
14
15
 
15
16
  [Test]
@@ -0,0 +1,60 @@
1
+ program Raindrops;
2
+
3
+ {$IFNDEF TESTINSIGHT}
4
+ {$APPTYPE CONSOLE}
5
+ {$ENDIF}{$STRONGLINKTYPES ON}
6
+ uses
7
+ System.SysUtils,
8
+ {$IFDEF TESTINSIGHT}
9
+ TestInsight.DUnitX,
10
+ {$ENDIF }
11
+ DUnitX.Loggers.Console,
12
+ DUnitX.Loggers.Xml.NUnit,
13
+ DUnitX.TestFramework,
14
+ uRaindropsTest in 'uRaindropsTest.pas',
15
+ uRaindrops in 'uRaindrops.pas';
16
+
17
+ var
18
+ runner : ITestRunner;
19
+ results : IRunResults;
20
+ logger : ITestLogger;
21
+ nunitLogger : ITestLogger;
22
+ begin
23
+ {$IFDEF TESTINSIGHT}
24
+ TestInsight.DUnitX.RunRegisteredTests;
25
+ exit;
26
+ {$ENDIF}
27
+ try
28
+ //Check command line options, will exit if invalid
29
+ TDUnitX.CheckCommandLine;
30
+ //Create the test runner
31
+ runner := TDUnitX.CreateRunner;
32
+ //Tell the runner to use RTTI to find Fixtures
33
+ runner.UseRTTI := True;
34
+ //tell the runner how we will log things
35
+ //Log to the console window
36
+ logger := TDUnitXConsoleLogger.Create(true);
37
+ runner.AddLogger(logger);
38
+ //Generate an NUnit compatible XML File
39
+ nunitLogger := TDUnitXXMLNUnitFileLogger.Create(TDUnitX.Options.XMLOutputFile);
40
+ runner.AddLogger(nunitLogger);
41
+ runner.FailsOnNoAsserts := False; //When true, Assertions must be made during tests;
42
+
43
+ //Run tests
44
+ results := runner.Execute;
45
+ if not results.AllPassed then
46
+ System.ExitCode := EXIT_ERRORS;
47
+
48
+ {$IFNDEF CI}
49
+ //We don't want this happening when running under CI.
50
+ if TDUnitX.Options.ExitBehavior = TDUnitXExitBehavior.Pause then
51
+ begin
52
+ System.Write('Done.. press <Enter> key to quit.');
53
+ System.Readln;
54
+ end;
55
+ {$ENDIF}
56
+ except
57
+ on E: Exception do
58
+ System.Writeln(E.ClassName, ': ', E.Message);
59
+ end;
60
+ end.
@@ -0,0 +1,27 @@
1
+ unit uRaindrops;
2
+
3
+ interface
4
+
5
+ type
6
+
7
+ Raindrops = class
8
+ class function Convert(aNumber: integer): string; static;
9
+ end;
10
+
11
+ implementation
12
+ uses System.SysUtils;
13
+
14
+ class function Raindrops.Convert(aNumber: integer): string;
15
+ begin
16
+ result := '';
17
+ if aNumber mod 3 = 0 then
18
+ result := result + 'Pling';
19
+ if aNumber mod 5 = 0 then
20
+ result := result + 'Plang';
21
+ if aNumber mod 7 = 0 then
22
+ result := result + 'Plong';
23
+ if result = '' then
24
+ result := aNumber.ToString;
25
+ end;
26
+
27
+ end.
@@ -0,0 +1,180 @@
1
+ unit uRaindropsTest;
2
+
3
+ interface
4
+ uses
5
+ DUnitX.TestFramework;
6
+
7
+ type
8
+
9
+ [TestFixture]
10
+ RaindropsTest = class(TObject)
11
+ public
12
+ [Test]
13
+ // [Ignore('Comment the "[Ignore]" statement to run the test')]
14
+ procedure the_sound_for_1_is_1;
15
+
16
+ [Test]
17
+ [Ignore]
18
+ procedure the_sound_for_3_is_Pling;
19
+
20
+ [Test]
21
+ [Ignore]
22
+ procedure the_sound_for_5_is_Plang;
23
+
24
+ [Test]
25
+ [Ignore]
26
+ procedure the_sound_for_7_is_Plong;
27
+
28
+ [Test]
29
+ [Ignore]
30
+ procedure the_sound_for_6_is_Pling_as_it_has_a_factor_3;
31
+
32
+ [Test]
33
+ [Ignore]
34
+ procedure _2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base;
35
+
36
+ [Test]
37
+ [Ignore]
38
+ procedure the_sound_for_9_is_Pling_as_it_has_a_factor_3;
39
+
40
+ [Test]
41
+ [Ignore]
42
+ procedure the_sound_for_10_is_Plang_as_it_has_a_factor_5;
43
+
44
+ [Test]
45
+ [Ignore]
46
+ procedure the_sound_for_14_is_Plong_as_it_has_a_factor_of_7;
47
+
48
+ [Test]
49
+ [Ignore]
50
+ procedure the_sound_for_15_is_PlingPlang_as_it_has_factors_3_and_5;
51
+
52
+ [Test]
53
+ [Ignore]
54
+ procedure the_sound_for_21_is_PlingPlong_as_it_has_factors_3_and_7;
55
+
56
+ [Test]
57
+ [Ignore]
58
+ procedure the_sound_for_25_is_Plang_as_it_has_a_factor_5;
59
+
60
+ [Test]
61
+ [Ignore]
62
+ procedure the_sound_for_27_is_Pling_as_it_has_a_factor_3;
63
+
64
+ [Test]
65
+ [Ignore]
66
+ procedure the_sound_for_35_is_PlangPlong_as_it_has_factors_5_and_7;
67
+
68
+ [Test]
69
+ [Ignore]
70
+ procedure the_sound_for_49_is_Plong_as_it_has_a_factor_7;
71
+
72
+ [Test]
73
+ [Ignore]
74
+ procedure the_sound_for_52_is_52;
75
+
76
+ [Test]
77
+ [Ignore]
78
+ procedure the_sound_for_105_is_PlingPlangPlong_as_it_has_factors_3_5_7;
79
+
80
+ [Test]
81
+ [Ignore]
82
+ procedure the_sound_for_3125_is_Plang_as_it_has_a_factor_5;
83
+ end;
84
+
85
+ implementation
86
+ uses uRaindrops;
87
+
88
+ procedure RaindropsTest.the_sound_for_1_is_1;
89
+ begin
90
+ Assert.AreEqual('1', Raindrops.Convert(1));
91
+ end;
92
+
93
+ procedure RaindropsTest.the_sound_for_3_is_Pling;
94
+ begin
95
+ Assert.AreEqual('Pling', Raindrops.Convert(3));
96
+ end;
97
+
98
+ procedure RaindropsTest.the_sound_for_5_is_Plang;
99
+ begin
100
+ Assert.AreEqual('Plang', Raindrops.Convert(5));
101
+ end;
102
+
103
+ procedure RaindropsTest.the_sound_for_7_is_Plong;
104
+ begin
105
+ Assert.AreEqual('Plong', Raindrops.Convert(7));
106
+ end;
107
+
108
+ procedure RaindropsTest.the_sound_for_6_is_Pling_as_it_has_a_factor_3;
109
+ begin
110
+ Assert.AreEqual('Pling', Raindrops.Convert(6));
111
+ end;
112
+
113
+ procedure RaindropsTest._2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base;
114
+ begin
115
+ Assert.AreEqual('8', Raindrops.Convert(8));
116
+ end;
117
+
118
+ procedure RaindropsTest.the_sound_for_9_is_Pling_as_it_has_a_factor_3;
119
+ begin
120
+ Assert.AreEqual('Pling', Raindrops.Convert(9));
121
+ end;
122
+
123
+ procedure RaindropsTest.the_sound_for_10_is_Plang_as_it_has_a_factor_5;
124
+ begin
125
+ Assert.AreEqual('Plang', Raindrops.Convert(10));
126
+ end;
127
+
128
+ procedure RaindropsTest.the_sound_for_14_is_Plong_as_it_has_a_factor_of_7;
129
+ begin
130
+ Assert.AreEqual('Plong', Raindrops.Convert(14));
131
+ end;
132
+
133
+ procedure RaindropsTest.the_sound_for_15_is_PlingPlang_as_it_has_factors_3_and_5;
134
+ begin
135
+ Assert.AreEqual('PlingPlang', Raindrops.Convert(15));
136
+ end;
137
+
138
+ procedure RaindropsTest.the_sound_for_21_is_PlingPlong_as_it_has_factors_3_and_7;
139
+ begin
140
+ Assert.AreEqual('PlingPlong', Raindrops.Convert(21));
141
+ end;
142
+
143
+ procedure RaindropsTest.the_sound_for_25_is_Plang_as_it_has_a_factor_5;
144
+ begin
145
+ Assert.AreEqual('Plang', Raindrops.Convert(25));
146
+ end;
147
+
148
+ procedure RaindropsTest.the_sound_for_27_is_Pling_as_it_has_a_factor_3;
149
+ begin
150
+ Assert.AreEqual('Pling', Raindrops.Convert(27));
151
+ end;
152
+
153
+ procedure RaindropsTest.the_sound_for_35_is_PlangPlong_as_it_has_factors_5_and_7;
154
+ begin
155
+ Assert.AreEqual('PlangPlong', Raindrops.Convert(35));
156
+ end;
157
+
158
+ procedure RaindropsTest.the_sound_for_49_is_Plong_as_it_has_a_factor_7;
159
+ begin
160
+ Assert.AreEqual('Plong', Raindrops.Convert(49));
161
+ end;
162
+
163
+ procedure RaindropsTest.the_sound_for_52_is_52;
164
+ begin
165
+ Assert.AreEqual('52', Raindrops.Convert(52));
166
+ end;
167
+
168
+ procedure RaindropsTest.the_sound_for_105_is_PlingPlangPlong_as_it_has_factors_3_5_7;
169
+ begin
170
+ Assert.AreEqual('PlingPlangPlong', Raindrops.Convert(105));
171
+ end;
172
+
173
+ procedure RaindropsTest.the_sound_for_3125_is_Plang_as_it_has_a_factor_5;
174
+ begin
175
+ Assert.AreEqual('Plang', Raindrops.Convert(3125));
176
+ end;
177
+
178
+ initialization
179
+ TDUnitX.RegisterTestFixture(RaindropsTest);
180
+ end.
@@ -1,4 +1,4 @@
1
- program TestRNATranscription;
1
+ program RNATranscription;
2
2
 
3
3
  {$IFNDEF TESTINSIGHT}
4
4
  {$APPTYPE CONSOLE}
@@ -9,34 +9,35 @@ type
9
9
  RnaTranscriptionTest = class(TObject)
10
10
  public
11
11
  [Test]
12
+ // [Ignore('Comment the "[Ignore]" statement to run the test')]
12
13
  procedure Rna_complement_of_cytosine_is_guanine;
13
14
 
14
15
  [Test]
15
- [Ignore('Comment this line to run this test')]
16
+ [Ignore]
16
17
  procedure Rna_complement_of_guanine_is_cytosine;
17
18
 
18
19
  [Test]
19
- [Ignore('Comment this line to run this test')]
20
+ [Ignore]
20
21
  procedure Rna_complement_of_thymine_is_adenine;
21
22
 
22
23
  [Test]
23
- [Ignore('Comment this line to run this test')]
24
+ [Ignore]
24
25
  procedure Rna_complement_of_adenine_is_uracil;
25
26
 
26
27
  [Test]
27
- [Ignore('Comment this line to run this test')]
28
+ [Ignore]
28
29
  procedure Rna_complement;
29
30
 
30
31
  [Test]
31
- [Ignore('Comment this line to run this test')]
32
+ [Ignore]
32
33
  procedure Dna_correctly_handles_invalid_input;
33
34
 
34
35
  [Test]
35
- [Ignore('Comment this line to run this test')]
36
+ [Ignore]
36
37
  procedure Dna_correctly_handles_completely_invalid_input;
37
38
 
38
39
  [Test]
39
- [Ignore('Comment this line to run this test')]
40
+ [Ignore]
40
41
  procedure Dna_correctly_handles_partially_invalid_input;
41
42
  end;
42
43
 
@@ -1,4 +1,4 @@
1
- program TestSaddlePoints;
1
+ program SaddlePoints;
2
2
 
3
3
  {$IFNDEF TESTINSIGHT}
4
4
  {$APPTYPE CONSOLE}
@@ -19,26 +19,27 @@ type
19
19
  TSaddlePointTests = class(TObject)
20
20
  public
21
21
  [Test]
22
+ // [Ignore('Comment the "[Ignore]" statement to run the test')]
22
23
  procedure Readme_example;
23
24
 
24
25
  [Test]
25
- [Ignore('Comment this line to run test')]
26
+ [Ignore]
26
27
  procedure No_saddle_point;
27
28
 
28
29
  [Test]
29
- [Ignore('Comment this line to run test')]
30
+ [Ignore]
30
31
  procedure Saddle_point;
31
32
 
32
33
  [Test]
33
- [Ignore('Comment this line to run test')]
34
+ [Ignore]
34
35
  procedure Another_saddle_point;
35
36
 
36
37
  [Test]
37
- [Ignore('Comment this line to run test')]
38
+ [Ignore]
38
39
  procedure Multiple_saddle_points;
39
40
 
40
41
  [Test]
41
- [Ignore('Comment this line to run test')]
42
+ [Ignore]
42
43
  procedure Five_by_five_matrix;
43
44
  end;
44
45
 
@@ -134,14 +134,22 @@
134
134
  ]
135
135
  },
136
136
  {
137
- "difficulty": 1,
137
+ "difficulty": 5,
138
138
  "slug": "secret-handshake",
139
- "topics": []
139
+ "topics": [
140
+ "Bitwise operations",
141
+ "Arrays",
142
+ "Integers"
143
+ ]
140
144
  },
141
145
  {
142
- "difficulty": 1,
146
+ "difficulty": 4,
143
147
  "slug": "house",
144
- "topics": []
148
+ "topics": [
149
+ "Strings",
150
+ "Text formatting",
151
+ "Recursion"
152
+ ]
145
153
  },
146
154
  {
147
155
  "difficulty": 1,
@@ -37,10 +37,8 @@ func TestTestVersion(t *testing.T) {
37
37
  func TestAccumulate(t *testing.T) {
38
38
  for _, test := range tests {
39
39
  actual := Accumulate(test.given, test.converter)
40
- if fmt.Sprintf("%s", actual) != fmt.Sprintf("%s", test.expected) {
41
- t.Fatalf("Accumulate(%s, %s): expected %s, actual %s", test.given, test.description, test.expected, actual)
42
- } else {
43
- t.Logf("PASS: %s %v", test.description, test.given)
40
+ if fmt.Sprintf("%q", actual) != fmt.Sprintf("%q", test.expected) {
41
+ t.Fatalf("Accumulate(%q, %q): expected %q, actual %q", test.given, test.description, test.expected, actual)
44
42
  }
45
43
  }
46
44
  }
@@ -0,0 +1,76 @@
1
+ package luhn
2
+
3
+ // Source: exercism/x-common
4
+ // Commit: 715e23e luhn: tweak canonical tests (#547)
5
+
6
+ var testCases = []struct {
7
+ description string
8
+ input string
9
+ ok bool
10
+ }{
11
+ {
12
+ "single digit strings can not be valid",
13
+ "1",
14
+ false,
15
+ },
16
+ {
17
+ "A single zero is invalid",
18
+ "0",
19
+ false,
20
+ },
21
+ {
22
+ "a simple valid SIN that remains valid if reversed",
23
+ "059",
24
+ true,
25
+ },
26
+ {
27
+ "a simple valid SIN that becomes invalid if reversed",
28
+ "59",
29
+ true,
30
+ },
31
+ {
32
+ "a valid Canadian SIN",
33
+ "055 444 285",
34
+ true,
35
+ },
36
+ {
37
+ "invalid Canadian SIN",
38
+ "055 444 286",
39
+ false,
40
+ },
41
+ {
42
+ "invalid credit card",
43
+ "8273 1232 7352 0569",
44
+ false,
45
+ },
46
+ {
47
+ "valid strings with a non-digit included become invalid",
48
+ "055a 444 285",
49
+ false,
50
+ },
51
+ {
52
+ "valid strings with punctuation included become invalid",
53
+ "055-444-285",
54
+ false,
55
+ },
56
+ {
57
+ "valid strings with symbols included become invalid",
58
+ "055£ 444$ 285",
59
+ false,
60
+ },
61
+ {
62
+ "single zero with space is invalid",
63
+ " 0",
64
+ false,
65
+ },
66
+ {
67
+ "more than a single zero is valid",
68
+ "0000 0",
69
+ true,
70
+ },
71
+ {
72
+ "input digit 9 is correctly converted to output digit 9",
73
+ "091",
74
+ true,
75
+ },
76
+ }