trackler 2.2.1.48 → 2.2.1.49

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/grains/canonical-data.json +1 -1
  4. data/problem-specifications/exercises/isbn-verifier/description.md +1 -1
  5. data/tracks/dart/exercises/anagram/pubspec.lock +10 -10
  6. data/tracks/dart/exercises/bob/pubspec.lock +4 -4
  7. data/tracks/dart/exercises/difference-of-squares/pubspec.lock +4 -4
  8. data/tracks/dart/exercises/gigasecond/pubspec.lock +4 -4
  9. data/tracks/dart/exercises/hamming/pubspec.lock +4 -4
  10. data/tracks/dart/exercises/hello-world/pubspec.lock +4 -4
  11. data/tracks/dart/exercises/leap/pubspec.lock +4 -4
  12. data/tracks/dart/exercises/phone-number/pubspec.lock +4 -4
  13. data/tracks/dart/exercises/raindrops/pubspec.lock +17 -5
  14. data/tracks/dart/exercises/rna-transcription/pubspec.lock +4 -4
  15. data/tracks/dart/exercises/word-count/pubspec.lock +4 -4
  16. data/tracks/dart/pubspec.lock +3 -3
  17. data/tracks/fsharp/exercises/largest-series-product/Example.fs +18 -4
  18. data/tracks/fsharp/exercises/largest-series-product/LargestSeriesProduct.fs +1 -1
  19. data/tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs +80 -36
  20. data/tracks/fsharp/generators/Exercise.fs +1 -1
  21. data/tracks/fsharp/generators/Generators.fs +10 -0
  22. data/tracks/gnu-apl/config.json +14 -0
  23. data/tracks/gnu-apl/exercises/difference-of-squares/README.md +19 -0
  24. data/tracks/gnu-apl/exercises/difference-of-squares/difference-of-squares-example.apl +13 -0
  25. data/tracks/gnu-apl/exercises/difference-of-squares/difference-of-squares.tc +38 -0
  26. data/tracks/gnu-apl/exercises/pangram/README.md +15 -0
  27. data/tracks/gnu-apl/exercises/pangram/pangram-example.apl +14 -0
  28. data/tracks/gnu-apl/exercises/pangram/pangram.tc +40 -0
  29. data/tracks/gnu-apl/exercises/raindrops/raindrops.tc +1 -1
  30. data/tracks/java/exercises/bracket-push/.meta/version +1 -0
  31. data/tracks/java/exercises/complex-numbers/.meta/version +1 -0
  32. data/tracks/java/exercises/ocr-numbers/.meta/version +1 -0
  33. data/tracks/java/exercises/queen-attack/.meta/version +1 -0
  34. data/tracks/java/exercises/rectangles/.meta/version +1 -0
  35. data/tracks/java/exercises/robot-simulator/.meta/version +1 -0
  36. data/tracks/java/exercises/secret-handshake/.meta/version +1 -0
  37. data/tracks/java/exercises/sublist/.meta/version +1 -0
  38. data/tracks/perl6/exercises/accumulate/accumulate.t +1 -6
  39. data/tracks/perl6/exercises/all-your-base/all-your-base.t +14 -19
  40. data/tracks/perl6/exercises/allergies/Allergies.pm6 +1 -1
  41. data/tracks/perl6/exercises/allergies/Example.pm6 +1 -1
  42. data/tracks/perl6/exercises/allergies/allergies.t +25 -29
  43. data/tracks/perl6/exercises/allergies/example.yaml +11 -10
  44. data/tracks/perl6/exercises/anagram/anagram.t +14 -19
  45. data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +14 -19
  46. data/tracks/perl6/exercises/bob/bob.t +16 -23
  47. data/tracks/perl6/exercises/bob/example.yaml +1 -3
  48. data/tracks/perl6/exercises/clock/clock.t +14 -19
  49. data/tracks/perl6/exercises/flatten-array/flatten-array.t +14 -19
  50. data/tracks/perl6/exercises/grade-school/grade-school.t +1 -6
  51. data/tracks/perl6/exercises/grains/grains.t +15 -20
  52. data/tracks/perl6/exercises/hello-world/example.yaml +1 -3
  53. data/tracks/perl6/exercises/hello-world/hello-world.t +16 -23
  54. data/tracks/perl6/exercises/leap/leap.t +14 -19
  55. data/tracks/perl6/exercises/linked-list/example.yaml +59 -59
  56. data/tracks/perl6/exercises/linked-list/linked-list.t +59 -64
  57. data/tracks/perl6/exercises/luhn/luhn.t +14 -19
  58. data/tracks/perl6/exercises/phone-number/phone-number.t +14 -19
  59. data/tracks/perl6/exercises/raindrops/raindrops.t +14 -19
  60. data/tracks/perl6/exercises/rna-transcription/rna-transcription.t +14 -19
  61. data/tracks/perl6/exercises/robot-name/robot-name.t +1 -6
  62. data/tracks/perl6/exercises/scrabble-score/scrabble-score.t +14 -19
  63. data/tracks/perl6/exercises/space-age/space-age.t +14 -19
  64. data/tracks/perl6/exercises/word-count/word-count.t +14 -19
  65. data/tracks/perl6/exercises/wordy/wordy.t +14 -19
  66. data/tracks/perl6/templates/test.mustache +19 -25
  67. data/tracks/purescript/config.json +12 -0
  68. data/tracks/purescript/exercises/sum-of-multiples/README.md +15 -0
  69. data/tracks/purescript/exercises/sum-of-multiples/bower.json +26 -0
  70. data/tracks/purescript/exercises/sum-of-multiples/examples/src/SumOfMultiples.purs +16 -0
  71. data/tracks/purescript/exercises/sum-of-multiples/src/SumOfMultiples.purs +3 -0
  72. data/tracks/purescript/exercises/sum-of-multiples/test/Main.purs +63 -0
  73. data/tracks/python/README.md +5 -1
  74. data/tracks/python/config.json +52 -9
  75. data/tracks/python/exercises/allergies/allergies_test.py +7 -7
  76. data/tracks/python/exercises/allergies/example.py +1 -1
  77. data/tracks/python/exercises/binary-search/binary_search_test.py +8 -5
  78. data/tracks/python/exercises/binary/binary_test.py +8 -4
  79. data/tracks/python/exercises/book-store/example.py +1 -1
  80. data/tracks/python/exercises/clock/clock.py +3 -0
  81. data/tracks/python/exercises/clock/clock_test.py +16 -16
  82. data/tracks/python/exercises/clock/example.py +1 -1
  83. data/tracks/python/exercises/list-ops/example.py +10 -29
  84. data/tracks/python/exercises/list-ops/list_ops.py +8 -12
  85. data/tracks/python/exercises/list-ops/list_ops_test.py +55 -86
  86. data/tracks/python/exercises/meetup/meetup_test.py +2 -2
  87. data/tracks/python/exercises/minesweeper/minesweeper_test.py +6 -3
  88. data/tracks/python/exercises/ocr-numbers/ocr_numbers_test.py +11 -8
  89. data/tracks/python/exercises/pangram/pangram_test.py +25 -16
  90. data/tracks/python/exercises/point-mutations/point_mutations.py +1 -1
  91. data/tracks/python/exercises/pythagorean-triplet/pythagorean_triplet_test.py +2 -1
  92. data/tracks/python/exercises/saddle-points/saddle_points_test.py +2 -1
  93. data/tracks/python/exercises/simple-cipher/simple_cipher_test.py +4 -2
  94. data/tracks/python/exercises/triangle/triangle_test.py +10 -5
  95. data/tracks/python/exercises/wordy/wordy_test.py +8 -5
  96. data/tracks/python/exercises/zipper/README.md +43 -0
  97. data/tracks/python/exercises/zipper/example.py +41 -0
  98. data/tracks/python/exercises/zipper/zipper.py +28 -0
  99. data/tracks/python/exercises/zipper/zipper_test.py +82 -0
  100. data/tracks/racket/.travis.yml +1 -1
  101. data/tracks/racket/config.json +14 -0
  102. data/tracks/racket/exercises/meetup/README.md +54 -0
  103. data/tracks/racket/exercises/meetup/example.rkt +45 -0
  104. data/tracks/racket/exercises/meetup/meetup-test.rkt +39 -0
  105. data/tracks/racket/exercises/meetup/meetup.rkt +3 -0
  106. metadata +29 -2
@@ -38,11 +38,6 @@ subtest 'Additional students', {
38
38
  ok $roster.?add-student(:name($_), :3grade), "Add $_ to grade 3" for <Tom Dick Harry>;
39
39
  }
40
40
  is $roster.?list-all, ('Grade 1', <Anna Barb Charlie>, 'Grade 2', <Alex Jim Zoe>, 'Grade 3', <Dick Harry Tom>), 'List all';
41
-
42
- done-testing;
43
-
44
41
  INIT {
45
- if %*ENV<EXERCISM> {
46
- $module = 'Example';
47
- }
42
+ $module = 'Example' if %*ENV<EXERCISM>;
48
43
  }
@@ -7,9 +7,7 @@ use JSON::Fast;
7
7
  my Str:D $exercise := 'Grains';
8
8
  my Version:D $version = v1;
9
9
  my Str $module //= $exercise;
10
- INIT {
11
- plan 13;
12
- }
10
+ plan 13;
13
11
 
14
12
  use-ok $module or bail-out;
15
13
  require ::($module);
@@ -33,7 +31,18 @@ for @($c-data<cases>[0]<cases>) {
33
31
  }
34
32
  is total-grains, |$c-data<cases>[1]<expected description>;
35
33
 
36
- done-testing;
34
+ unless %*ENV<EXERCISM> {
35
+ skip-rest 'exercism tests';
36
+ exit;
37
+ }
38
+
39
+ subtest 'canonical-data' => {
40
+ (my $c-data-file = "$dir/../../problem-specifications/exercises/{
41
+ $dir.IO.resolve.basename
42
+ }/canonical-data.json".IO.resolve) ~~ :f ??
43
+ is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
44
+ flunk 'problem-specifications file not found';
45
+ }
37
46
 
38
47
  INIT {
39
48
  $c-data := from-json q:to/END/;
@@ -43,7 +52,7 @@ $c-data := from-json q:to/END/;
43
52
  "version": "1.0.0",
44
53
  "comments": [
45
54
  "The final tests of square test error conditions",
46
- "The expection for these tests is -1, indicating an error",
55
+ "The expectation for these tests is -1, indicating an error",
47
56
  "In these cases you should expect an error as is idiomatic for your language"
48
57
  ],
49
58
  "cases": [
@@ -122,19 +131,5 @@ $c-data := from-json q:to/END/;
122
131
 
123
132
  END
124
133
 
125
- if %*ENV<EXERCISM> {
126
- $module = 'Example';
127
- if (my $c-data-file =
128
- "$dir/../../problem-specifications/exercises/{$dir.IO.resolve.basename}/canonical-data.json"
129
- .IO.resolve) ~~ :f
130
- {
131
- is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'canonical-data';
132
- }
133
- else {
134
- flunk 'canonical-data';
135
- }
136
- }
137
- else {
138
- skip;
139
- }
134
+ $module = 'Example' if %*ENV<EXERCISM>;
140
135
  }
@@ -15,9 +15,7 @@ plan_comment: This is how many tests we expect to run.
15
15
  use_test_comment: Check that the module can be use-d.
16
16
  version_test_comment: "If the exercise is updated, we want to make sure other people testing\nyour code don't think you've made a mistake if things have changed!"
17
17
  imports_comment: Import '&hello' from 'HelloWorld'
18
- exercism_comment: "Don't worry about the stuff in here for your exercise.\nThis is for Exercism folks to check that everything is in order."
19
- done_testing_comment: There are no more tests after this :)
20
- INIT_comment: "'INIT' is a phaser, it makes sure that the test data is available before everything else\nstarts running (otherwise we'd have to shove the test data into the middle of the file!)"
18
+ exercism_comment: "Don't worry about the stuff below here for your exercise.\nThis is for Exercism folks to check that everything is in order."
21
19
 
22
20
  unit: module
23
21
  unit_comment: |
@@ -7,9 +7,7 @@ use JSON::Fast;
7
7
  my Str:D $exercise := 'HelloWorld'; #`[The name of this exercise.]
8
8
  my Version:D $version = v2; #`[The version we will be matching against the exercise.]
9
9
  my Str $module //= $exercise; #`[The name of the module file to be loaded.]
10
- INIT {
11
- plan 3; #`[This is how many tests we expect to run.]
12
- }
10
+ plan 3; #`[This is how many tests we expect to run.]
13
11
 
14
12
  #`[Check that the module can be use-d.]
15
13
  use-ok $module or bail-out;
@@ -32,10 +30,21 @@ my $c-data;
32
30
  and check that &hello gives us the correct response.]
33
31
  is hello, |.<expected description> for @($c-data<cases>);
34
32
 
35
- done-testing; #`[There are no more tests after this :)]
33
+ #`[Don't worry about the stuff below here for your exercise.
34
+ This is for Exercism folks to check that everything is in order.]
35
+ unless %*ENV<EXERCISM> {
36
+ skip-rest 'exercism tests';
37
+ exit;
38
+ }
39
+
40
+ subtest 'canonical-data' => {
41
+ (my $c-data-file = "$dir/../../problem-specifications/exercises/{
42
+ $dir.IO.resolve.basename
43
+ }/canonical-data.json".IO.resolve) ~~ :f ??
44
+ is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
45
+ flunk 'problem-specifications file not found';
46
+ }
36
47
 
37
- #`['INIT' is a phaser, it makes sure that the test data is available before everything else
38
- starts running (otherwise we'd have to shove the test data into the middle of the file!)]
39
48
  INIT {
40
49
  $c-data := from-json q:to/END/;
41
50
 
@@ -53,21 +62,5 @@ $c-data := from-json q:to/END/;
53
62
 
54
63
  END
55
64
 
56
- if %*ENV<EXERCISM> {
57
- #`[Don't worry about the stuff in here for your exercise.
58
- This is for Exercism folks to check that everything is in order.]
59
- $module = 'Example';
60
- if (my $c-data-file =
61
- "$dir/../../problem-specifications/exercises/{$dir.IO.resolve.basename}/canonical-data.json"
62
- .IO.resolve) ~~ :f
63
- {
64
- is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'canonical-data';
65
- }
66
- else {
67
- flunk 'canonical-data';
68
- }
69
- }
70
- else {
71
- skip;
72
- }
65
+ $module = 'Example' if %*ENV<EXERCISM>;
73
66
  }
@@ -7,9 +7,7 @@ use JSON::Fast;
7
7
  my Str:D $exercise := 'Leap';
8
8
  my Version:D $version = v2;
9
9
  my Str $module //= $exercise;
10
- INIT {
11
- plan 6;
12
- }
10
+ plan 6;
13
11
 
14
12
  use-ok $module or bail-out;
15
13
  require ::($module);
@@ -26,7 +24,18 @@ require ::($module) <&is-leap-year>;
26
24
  my $c-data;
27
25
  is is-leap-year(.<input>), |.<expected description> for @($c-data<cases>);
28
26
 
29
- done-testing;
27
+ unless %*ENV<EXERCISM> {
28
+ skip-rest 'exercism tests';
29
+ exit;
30
+ }
31
+
32
+ subtest 'canonical-data' => {
33
+ (my $c-data-file = "$dir/../../problem-specifications/exercises/{
34
+ $dir.IO.resolve.basename
35
+ }/canonical-data.json".IO.resolve) ~~ :f ??
36
+ is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
37
+ flunk 'problem-specifications file not found';
38
+ }
30
39
 
31
40
  INIT {
32
41
  $c-data := from-json q:to/END/;
@@ -64,19 +73,5 @@ $c-data := from-json q:to/END/;
64
73
 
65
74
  END
66
75
 
67
- if %*ENV<EXERCISM> {
68
- $module = 'Example';
69
- if (my $c-data-file =
70
- "$dir/../../problem-specifications/exercises/{$dir.IO.resolve.basename}/canonical-data.json"
71
- .IO.resolve) ~~ :f
72
- {
73
- is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'canonical-data';
74
- }
75
- else {
76
- flunk 'canonical-data';
77
- }
78
- }
79
- else {
80
- skip;
81
- }
76
+ $module = 'Example' if %*ENV<EXERCISM>;
82
77
  }
@@ -5,7 +5,8 @@ modules:
5
5
  - use: JSON::Fast
6
6
  methods: 'push-list pop-list shift-list unshift-list'
7
7
  tests: |
8
- for my @cases -> $case {
8
+ my $cases = from-json $=pod.pop.contents;
9
+ for $cases.values -> $case {
9
10
  subtest $case.<name>, sub {
10
11
  my $linkedlist = ::($exercise).new;
11
12
  for |$case.<set> -> %set {
@@ -21,64 +22,63 @@ tests: |
21
22
  }
22
23
  }
23
24
  }
24
- after_done_testing: |
25
- INIT {
26
- @cases := from-json 「
27
- [
28
- {
29
- "set" : [
30
- { "push" : 10 },
31
- { "push" : 20 },
32
- { "pop" : 20 },
33
- { "pop" : 10 }
34
- ],
35
- "name" : "push_pop"
36
- },
37
- {
38
- "set" : [
39
- { "push" : 10 },
40
- { "push" : 20 },
41
- { "shift" : 10 },
42
- { "shift" : 20 }
43
- ],
44
- "name" : "push_shift"
45
- },
46
- {
47
- "set" : [
48
- { "unshift" : 10 },
49
- { "unshift" : 20 },
50
- { "shift" : 20 },
51
- { "shift" : 10 }
52
- ],
53
- "name" : "unshift_shift"
54
- },
55
- {
56
- "set" : [
57
- { "unshift" : 10 },
58
- { "unshift" : 20 },
59
- { "pop" : 10 },
60
- { "pop" : 20 }
61
- ],
62
- "name" : "unshift_pop"
63
- },
64
- {
65
- "set" : [
66
- { "push" : 10 },
67
- { "push" : 20 },
68
- { "pop" : 20 },
69
- { "push" : 30 },
70
- { "shift" : 10 },
71
- { "unshift" : 40 },
72
- { "push" : 50 },
73
- { "shift" : 40 },
74
- { "pop" : 50 },
75
- { "shift" : 30 }
76
- ],
77
- "name" : "example"
78
- }
79
- ]
80
-
81
- }
25
+
26
+ =head2 Test Data
27
+ =begin code
28
+ [
29
+ {
30
+ "set" : [
31
+ { "push" : 10 },
32
+ { "push" : 20 },
33
+ { "pop" : 20 },
34
+ { "pop" : 10 }
35
+ ],
36
+ "name" : "push_pop"
37
+ },
38
+ {
39
+ "set" : [
40
+ { "push" : 10 },
41
+ { "push" : 20 },
42
+ { "shift" : 10 },
43
+ { "shift" : 20 }
44
+ ],
45
+ "name" : "push_shift"
46
+ },
47
+ {
48
+ "set" : [
49
+ { "unshift" : 10 },
50
+ { "unshift" : 20 },
51
+ { "shift" : 20 },
52
+ { "shift" : 10 }
53
+ ],
54
+ "name" : "unshift_shift"
55
+ },
56
+ {
57
+ "set" : [
58
+ { "unshift" : 10 },
59
+ { "unshift" : 20 },
60
+ { "pop" : 10 },
61
+ { "pop" : 20 }
62
+ ],
63
+ "name" : "unshift_pop"
64
+ },
65
+ {
66
+ "set" : [
67
+ { "push" : 10 },
68
+ { "push" : 20 },
69
+ { "pop" : 20 },
70
+ { "push" : 30 },
71
+ { "shift" : 10 },
72
+ { "unshift" : 40 },
73
+ { "push" : 50 },
74
+ { "shift" : 40 },
75
+ { "pop" : 50 },
76
+ { "shift" : 30 }
77
+ ],
78
+ "name" : "example"
79
+ }
80
+ ]
81
+ =end code
82
82
 
83
83
  unit: class
84
84
  example: |
@@ -23,7 +23,8 @@ subtest 'Class methods', {
23
23
  ok ::($exercise).can($_), $_ for <push-list pop-list shift-list unshift-list>;
24
24
  }
25
25
 
26
- for my @cases -> $case {
26
+ my $cases = from-json $=pod.pop.contents;
27
+ for $cases.values -> $case {
27
28
  subtest $case.<name>, sub {
28
29
  my $linkedlist = ::($exercise).new;
29
30
  for |$case.<set> -> %set {
@@ -40,68 +41,62 @@ for my @cases -> $case {
40
41
  }
41
42
  }
42
43
 
43
- done-testing;
44
-
45
- INIT {
46
- @cases := from-json 「
47
- [
48
- {
49
- "set" : [
50
- { "push" : 10 },
51
- { "push" : 20 },
52
- { "pop" : 20 },
53
- { "pop" : 10 }
54
- ],
55
- "name" : "push_pop"
56
- },
57
- {
58
- "set" : [
59
- { "push" : 10 },
60
- { "push" : 20 },
61
- { "shift" : 10 },
62
- { "shift" : 20 }
63
- ],
64
- "name" : "push_shift"
65
- },
66
- {
67
- "set" : [
68
- { "unshift" : 10 },
69
- { "unshift" : 20 },
70
- { "shift" : 20 },
71
- { "shift" : 10 }
72
- ],
73
- "name" : "unshift_shift"
74
- },
75
- {
76
- "set" : [
77
- { "unshift" : 10 },
78
- { "unshift" : 20 },
79
- { "pop" : 10 },
80
- { "pop" : 20 }
81
- ],
82
- "name" : "unshift_pop"
83
- },
84
- {
85
- "set" : [
86
- { "push" : 10 },
87
- { "push" : 20 },
88
- { "pop" : 20 },
89
- { "push" : 30 },
90
- { "shift" : 10 },
91
- { "unshift" : 40 },
92
- { "push" : 50 },
93
- { "shift" : 40 },
94
- { "pop" : 50 },
95
- { "shift" : 30 }
96
- ],
97
- "name" : "example"
98
- }
99
- ]
100
-
101
- }
102
-
103
- INIT {
104
- if %*ENV<EXERCISM> {
105
- $module = 'Example';
44
+ =head2 Test Data
45
+ =begin code
46
+ [
47
+ {
48
+ "set" : [
49
+ { "push" : 10 },
50
+ { "push" : 20 },
51
+ { "pop" : 20 },
52
+ { "pop" : 10 }
53
+ ],
54
+ "name" : "push_pop"
55
+ },
56
+ {
57
+ "set" : [
58
+ { "push" : 10 },
59
+ { "push" : 20 },
60
+ { "shift" : 10 },
61
+ { "shift" : 20 }
62
+ ],
63
+ "name" : "push_shift"
64
+ },
65
+ {
66
+ "set" : [
67
+ { "unshift" : 10 },
68
+ { "unshift" : 20 },
69
+ { "shift" : 20 },
70
+ { "shift" : 10 }
71
+ ],
72
+ "name" : "unshift_shift"
73
+ },
74
+ {
75
+ "set" : [
76
+ { "unshift" : 10 },
77
+ { "unshift" : 20 },
78
+ { "pop" : 10 },
79
+ { "pop" : 20 }
80
+ ],
81
+ "name" : "unshift_pop"
82
+ },
83
+ {
84
+ "set" : [
85
+ { "push" : 10 },
86
+ { "push" : 20 },
87
+ { "pop" : 20 },
88
+ { "push" : 30 },
89
+ { "shift" : 10 },
90
+ { "unshift" : 40 },
91
+ { "push" : 50 },
92
+ { "shift" : 40 },
93
+ { "pop" : 50 },
94
+ { "shift" : 30 }
95
+ ],
96
+ "name" : "example"
106
97
  }
98
+ ]
99
+ =end code
100
+ INIT {
101
+ $module = 'Example' if %*ENV<EXERCISM>;
107
102
  }