trackler 2.2.1.61 → 2.2.1.62

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/forth/canonical-data.json +1 -7
  4. data/problem-specifications/exercises/meetup/description.md +16 -12
  5. data/problem-specifications/exercises/sum-of-multiples/description.md +3 -3
  6. data/tracks/c/config.json +14 -1
  7. data/tracks/c/exercises/anagram/src/anagram.h +19 -4
  8. data/tracks/c/exercises/anagram/src/example.c +27 -40
  9. data/tracks/c/exercises/anagram/test/test_anagram.c +100 -152
  10. data/tracks/c/exercises/sublist/README.md +53 -0
  11. data/tracks/c/exercises/sublist/makefile +15 -0
  12. data/tracks/c/exercises/sublist/src/example.c +63 -0
  13. data/tracks/c/exercises/sublist/src/sublist.h +17 -0
  14. data/tracks/c/exercises/sublist/test/test_sublist.c +243 -0
  15. data/tracks/c/exercises/sublist/test/vendor/unity.c +1300 -0
  16. data/tracks/c/exercises/sublist/test/vendor/unity.h +274 -0
  17. data/tracks/c/exercises/sublist/test/vendor/unity_internals.h +701 -0
  18. data/tracks/ecmascript/config.json +56 -0
  19. data/tracks/ecmascript/exercises/rectangles/README.md +95 -0
  20. data/tracks/ecmascript/exercises/rectangles/example.js +38 -0
  21. data/tracks/ecmascript/exercises/rectangles/package.json +72 -0
  22. data/tracks/ecmascript/exercises/rectangles/rectangles.spec.js +147 -0
  23. data/tracks/ecmascript/exercises/rotational-cipher/README.md +66 -0
  24. data/tracks/ecmascript/exercises/rotational-cipher/example.js +16 -0
  25. data/tracks/ecmascript/exercises/rotational-cipher/package.json +72 -0
  26. data/tracks/ecmascript/exercises/rotational-cipher/rotational-cipher.spec.js +73 -0
  27. data/tracks/ecmascript/exercises/spiral-matrix/README.md +59 -0
  28. data/tracks/ecmascript/exercises/spiral-matrix/example.js +26 -0
  29. data/tracks/ecmascript/exercises/spiral-matrix/package.json +72 -0
  30. data/tracks/ecmascript/exercises/spiral-matrix/spiral-matrix.spec.js +55 -0
  31. data/tracks/ecmascript/exercises/transpose/README.md +94 -0
  32. data/tracks/ecmascript/exercises/transpose/example.js +12 -0
  33. data/tracks/ecmascript/exercises/transpose/package.json +71 -0
  34. data/tracks/ecmascript/exercises/transpose/transpose.spec.js +121 -0
  35. data/tracks/go/exercises/allergies/.meta/gen.go +88 -0
  36. data/tracks/go/exercises/allergies/allergies_test.go +19 -46
  37. data/tracks/go/exercises/allergies/cases_test.go +60 -0
  38. data/tracks/go/exercises/bob/bob.go +0 -2
  39. data/tracks/go/exercises/forth/cases_test.go +2 -7
  40. data/tracks/go/exercises/nucleotide-count/nucleotide_count.go +0 -2
  41. data/tracks/go/exercises/pangram/.meta/gen.go +54 -0
  42. data/tracks/go/exercises/pangram/cases_test.go +62 -0
  43. data/tracks/go/exercises/pangram/example.go +3 -5
  44. data/tracks/go/exercises/pangram/pangram_test.go +3 -24
  45. data/tracks/go/exercises/rna-transcription/rna_transcription.go +0 -2
  46. data/tracks/go/exercises/robot-name/bonus_example.go +0 -2
  47. data/tracks/java/exercises/acronym/.meta/src/reference/java/Acronym.java +3 -3
  48. data/tracks/lfe/config.json +4 -3
  49. data/tracks/perl6/docs/SNIPPET.txt +8 -3
  50. data/tracks/perl6/exercises/allergies/Allergies.pm6 +1 -1
  51. data/tracks/perl6/exercises/allergies/Example.pm6 +1 -1
  52. data/tracks/perl6/exercises/allergies/allergies.t +10 -2
  53. data/tracks/perl6/exercises/allergies/example.yaml +10 -2
  54. data/tracks/perl6/exercises/leap/Example.pm6 +1 -1
  55. data/tracks/perl6/exercises/leap/Leap.pm6 +1 -1
  56. data/tracks/perl6/exercises/leap/example.yaml +10 -2
  57. data/tracks/perl6/exercises/leap/leap.t +10 -2
  58. data/tracks/perl6/exercises/luhn/Example.pm6 +1 -1
  59. data/tracks/perl6/exercises/luhn/Luhn.pm6 +1 -1
  60. data/tracks/perl6/exercises/luhn/example.yaml +10 -2
  61. data/tracks/perl6/exercises/luhn/luhn.t +10 -2
  62. data/tracks/perl6/exercises/pangram/Example.pm6 +1 -1
  63. data/tracks/perl6/exercises/pangram/Pangram.pm6 +1 -1
  64. data/tracks/perl6/exercises/pangram/example.yaml +12 -6
  65. data/tracks/perl6/exercises/pangram/pangram.t +9 -3
  66. data/tracks/python/config.json +38 -0
  67. data/tracks/python/exercises/complex-numbers/complex_numbers_test.py +81 -66
  68. data/tracks/python/exercises/connect/README.md +44 -0
  69. data/tracks/python/exercises/connect/connect.py +7 -0
  70. data/tracks/python/exercises/connect/connect_test.py +118 -0
  71. data/tracks/python/exercises/connect/example.py +61 -0
  72. data/tracks/python/exercises/go-counting/README.md +44 -0
  73. data/tracks/python/exercises/go-counting/example.py +62 -0
  74. data/tracks/python/exercises/go-counting/go_counting.py +38 -0
  75. data/tracks/python/exercises/go-counting/go_counting_test.py +92 -0
  76. data/tracks/python/exercises/parallel-letter-frequency/README.md +24 -0
  77. data/tracks/python/exercises/parallel-letter-frequency/example.py +56 -0
  78. data/tracks/python/exercises/parallel-letter-frequency/parallel_letter_frequency.py +2 -0
  79. data/tracks/python/exercises/parallel-letter-frequency/parallel_letter_frequency_test.py +61 -0
  80. data/tracks/python/exercises/strain/README.md +3 -1
  81. data/tracks/python/exercises/strain/strain.py +2 -2
  82. data/tracks/rust/.travis.yml +1 -0
  83. data/tracks/rust/README.md +2 -0
  84. data/tracks/rust/_test/check-exercises.sh +41 -54
  85. data/tracks/rust/_test/ensure-readmes-are-updated.sh +40 -0
  86. data/tracks/rust/bin/test-exercise +84 -0
  87. data/tracks/rust/exercises/alphametics/.meta/test-in-release-mode +2 -0
  88. data/tracks/rust/exercises/alphametics/src/lib.rs +1 -1
  89. data/tracks/rust/exercises/dominoes/README.md +3 -3
  90. data/tracks/rust/exercises/isbn-verifier/README.md +3 -2
  91. data/tracks/rust/exercises/nucleotide-count/README.md +2 -2
  92. data/tracks/rust/exercises/perfect-numbers/src/lib.rs +10 -0
  93. data/tracks/rust/exercises/phone-number/README.md +1 -1
  94. data/tracks/rust/exercises/pythagorean-triplet/src/lib.rs +3 -0
  95. data/tracks/rust/exercises/rectangles/README.md +9 -9
  96. data/tracks/rust/exercises/two-bucket/README.md +7 -7
  97. data/tracks/typescript/config.json +16 -0
  98. data/tracks/typescript/exercises/diamond/README.md +84 -0
  99. data/tracks/typescript/exercises/diamond/diamond.example.ts +51 -0
  100. data/tracks/typescript/exercises/diamond/diamond.test.ts +35 -0
  101. data/tracks/typescript/exercises/diamond/diamond.ts +0 -0
  102. data/tracks/typescript/exercises/diamond/package.json +36 -0
  103. data/tracks/typescript/exercises/diamond/tsconfig.json +22 -0
  104. data/tracks/typescript/exercises/diamond/tslint.json +127 -0
  105. data/tracks/typescript/exercises/diamond/yarn.lock +2624 -0
  106. metadata +53 -2
@@ -5,8 +5,6 @@
5
5
  // https://golang.org/doc/effective_go.html#commentary
6
6
  package bob
7
7
 
8
- const testVersion = 3
9
-
10
8
  // Hey should have a comment documenting it.
11
9
  func Hey(remark string) string {
12
10
  // Write some code here to pass the test suite.
@@ -1,8 +1,8 @@
1
1
  package forth
2
2
 
3
3
  // Source: exercism/problem-specifications
4
- // Commit: 1b4165d Add test for Forth that an operator can be overridden.
5
- // Problem Specifications Version: 1.2.0
4
+ // Commit: 3cb5e76 forth: Remove test for empty input (#976)
5
+ // Problem Specifications Version: 1.3.0
6
6
 
7
7
  type testGroup struct {
8
8
  group string
@@ -19,11 +19,6 @@ var testGroups = []testGroup{
19
19
  {
20
20
  group: "parsing and numbers",
21
21
  tests: []testCase{
22
- {
23
- "empty input results in empty stack",
24
- []string{},
25
- []int{},
26
- },
27
22
  {
28
23
  "numbers just get pushed onto the stack",
29
24
  []string{"1 2 3 4 5"},
@@ -1,7 +1,5 @@
1
1
  package dna
2
2
 
3
- const testVersion = 2
4
-
5
3
  // Histogram is a mapping from nucleotide to its count in given DNA.
6
4
  // Choose a suitable data type.
7
5
  type Histogram
@@ -0,0 +1,54 @@
1
+ package main
2
+
3
+ import (
4
+ "log"
5
+ "text/template"
6
+
7
+ "../../../gen"
8
+ )
9
+
10
+ func main() {
11
+ t, err := template.New("").Parse(tmpl)
12
+ if err != nil {
13
+ log.Fatal(err)
14
+ }
15
+ var j js
16
+ if err := gen.Gen("pangram", &j, t); err != nil {
17
+ log.Fatal(err)
18
+ }
19
+ }
20
+
21
+ // The JSON structure we expect to be able to unmarshal into
22
+ type js struct {
23
+ Exercise string
24
+ Version string
25
+ Cases []struct {
26
+ Cases []oneCase
27
+ }
28
+ }
29
+
30
+ // Test cases
31
+ type oneCase struct {
32
+ Description string
33
+ Property string
34
+ Input string
35
+ Expected bool
36
+ }
37
+
38
+ // Template to generate test cases.
39
+ var tmpl = `package pangram
40
+
41
+ {{.Header}}
42
+
43
+ var testCases = []struct {
44
+ description string
45
+ input string
46
+ expected bool
47
+ }{ {{range .J.Cases}}{{range .Cases}}
48
+ {
49
+ description: {{printf "%q" .Description}},
50
+ input: {{printf "%q" .Input}},
51
+ expected: {{printf "%t" .Expected}},
52
+ },{{end}}{{end}}
53
+ }
54
+ `
@@ -0,0 +1,62 @@
1
+ package pangram
2
+
3
+ // Source: exercism/problem-specifications
4
+ // Commit: d79e13e pangram: fix duplicative case for a missing 'x' (#958)
5
+ // Problem Specifications Version: 1.3.0
6
+
7
+ var testCases = []struct {
8
+ description string
9
+ input string
10
+ expected bool
11
+ }{
12
+ {
13
+ description: "sentence empty",
14
+ input: "",
15
+ expected: false,
16
+ },
17
+ {
18
+ description: "recognizes a perfect lower case pangram",
19
+ input: "abcdefghijklmnopqrstuvwxyz",
20
+ expected: true,
21
+ },
22
+ {
23
+ description: "pangram with only lower case",
24
+ input: "the quick brown fox jumps over the lazy dog",
25
+ expected: true,
26
+ },
27
+ {
28
+ description: "missing character 'x'",
29
+ input: "a quick movement of the enemy will jeopardize five gunboats",
30
+ expected: false,
31
+ },
32
+ {
33
+ description: "another missing character, e.g. 'h'",
34
+ input: "five boxing wizards jump quickly at it",
35
+ expected: false,
36
+ },
37
+ {
38
+ description: "pangram with underscores",
39
+ input: "the_quick_brown_fox_jumps_over_the_lazy_dog",
40
+ expected: true,
41
+ },
42
+ {
43
+ description: "pangram with numbers",
44
+ input: "the 1 quick brown fox jumps over the 2 lazy dogs",
45
+ expected: true,
46
+ },
47
+ {
48
+ description: "missing letters replaced by numbers",
49
+ input: "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog",
50
+ expected: false,
51
+ },
52
+ {
53
+ description: "pangram with mixed case and punctuation",
54
+ input: "\"Five quacking Zephyrs jolt my wax bed.\"",
55
+ expected: true,
56
+ },
57
+ {
58
+ description: "upper and lower case versions of the same character should not be counted separately",
59
+ input: "the quick brown fox jumps over with lazy FX",
60
+ expected: false,
61
+ },
62
+ }
@@ -1,14 +1,12 @@
1
1
  package pangram
2
2
 
3
- import (
4
- "strings"
5
- )
3
+ import "strings"
6
4
 
5
+ // IsPangram checks if given string is a pangram
7
6
  func IsPangram(s string) bool {
8
- lowerString := strings.ToLower(s)
9
7
  var check [26]bool
10
8
  var count int
11
- for _, c := range lowerString {
9
+ for _, c := range strings.ToLower(s) {
12
10
  if c >= 'a' {
13
11
  if c > 'z' {
14
12
  continue
@@ -4,33 +4,12 @@ import (
4
4
  "testing"
5
5
  )
6
6
 
7
- type testCase struct {
8
- input string
9
- expected bool
10
- failureReason string
11
- }
12
-
13
- var testCases = []testCase{
14
- {"", false, "sentence empty"},
15
- {"The quick brown fox jumps over the lazy dog", true, ""},
16
- {"a quick movement of the enemy will jeopardize five gunboats", false, "missing character 'x'"},
17
- {"the quick brown fish jumps over the lazy dog", false, "another missing character 'x'"},
18
- {"the 1 quick brown fox jumps over the 2 lazy dogs", true, ""},
19
- {"7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog", false, "missing letters replaced by numbers"},
20
- {"\"Five quacking Zephyrs jolt my wax bed.\"", true, ""},
21
- {"abcdefghijklmnopqrstuvwxy", false, "missing character 'z'"},
22
- {"bcdefghijklmnopqrstuvwxyz", false, "missing character 'a'"},
23
- }
24
-
25
7
  func TestPangram(t *testing.T) {
26
8
  for _, test := range testCases {
27
- actual := IsPangram(test.input)
28
- if actual != test.expected {
29
- t.Errorf("Pangram test [%s], expected [%t], actual [%t]", test.input, test.expected, actual)
30
- if !test.expected {
31
- t.Logf("[%s] should not be a pangram because : %s\n", test.input, test.failureReason)
32
- }
9
+ if actual := IsPangram(test.input); actual != test.expected {
10
+ t.Fatalf("FAIL: %s\nInput %q expected [%t], actual [%t]", test.description, test.input, test.expected, actual)
33
11
  }
12
+ t.Logf("PASS: %s", test.description)
34
13
  }
35
14
  }
36
15
 
@@ -1,6 +1,4 @@
1
1
  package strand
2
2
 
3
- const testVersion = 3
4
-
5
3
  func ToRNA(dna string) string {
6
4
  }
@@ -7,8 +7,6 @@ import (
7
7
  "math/rand"
8
8
  )
9
9
 
10
- const testVersion = 1
11
-
12
10
  type Robot struct {
13
11
  name string
14
12
  }
@@ -16,11 +16,11 @@ final class Acronym {
16
16
  private String generateAcronym(String phrase){
17
17
  final Pattern BREAK_WORDS = Pattern.compile("[A-Z]+[a-z]*|[a-z]+");
18
18
  final Matcher matcher = BREAK_WORDS.matcher(phrase);
19
- final StringBuilder b = new StringBuilder();
19
+ final StringBuilder stringBuilder = new StringBuilder();
20
20
  while (matcher.find()){
21
- b.append(matcher.group().charAt(0));
21
+ stringBuilder.append(matcher.group().charAt(0));
22
22
  }
23
- return b.toString().toUpperCase();
23
+ return stringBuilder.toString().toUpperCase();
24
24
  }
25
25
 
26
26
  }
@@ -1,4 +1,6 @@
1
1
  {
2
+ "language": "LFE",
3
+ "blurb": "Lisp Flavoured Erlang is one of those eat your cake and have it too programming languages. As they say: It's the best of Erlang and of Lisp; at the same time!",
2
4
  "active": true,
3
5
  "exercises": [
4
6
  {
@@ -247,6 +249,5 @@
247
249
  "uuid": "d706e999-482a-42de-8492-0a65e6258c19"
248
250
  }
249
251
  ],
250
- "foregone": [],
251
- "language": "Lisp Flavoured Erlang (LFE)"
252
- }
252
+ "foregone": []
253
+ }
@@ -1,5 +1,10 @@
1
- unit module HelloWorld;
1
+ say my $candidates = all
2
+ (‘Alphabet’, ‘subdermatoglyphic’,
3
+ ‘Emily Jung Schwartzkopf’).pick: 2;
2
4
 
3
- sub hello is export {
4
- 'Hello, World!'
5
+ say “All isograms? {$_ ?? ‘✔’ !! ‘❌’}”
6
+ given is-isogram($candidates).so;
7
+
8
+ sub is-isogram (Str $_ --> Bool) {
9
+ .uc.comb(/<:L>/).Bag ⊆ 'A'..'Z';
5
10
  }
@@ -1 +1 @@
1
- unit module Allergies:ver<2>;
1
+ unit module Allergies:ver<3>;
@@ -1,4 +1,4 @@
1
- unit module Allergies:ver<2>;
1
+ unit module Allergies:ver<3>;
2
2
 
3
3
  our @allergens = <
4
4
  eggs
@@ -5,7 +5,7 @@ use lib my $dir = $?FILE.IO.dirname;
5
5
  use JSON::Fast;
6
6
 
7
7
  my Str:D $exercise := 'Allergies';
8
- my Version:D $version = v2;
8
+ my Version:D $version = v3;
9
9
  my Str $module //= $exercise;
10
10
  plan 4;
11
11
 
@@ -27,7 +27,15 @@ for $c-data<cases>.values -> %case-set {
27
27
  subtest 'allergic-to' => {
28
28
  plan 7;
29
29
  for %case-set<cases>.values -> %case {
30
- is allergic-to(%case<score>, .<substance>), .<result>, %case<description> ~ ': ' ~ .<substance> for %case<expected>.values;
30
+ for %case<expected>.values {
31
+ given allergic-to %case<score>, .<substance> -> $result {
32
+ subtest %case<description> ~ ': ' ~ .<substance> => {
33
+ plan 2;
34
+ isa-ok $result, Bool;
35
+ is-deeply $result, .<result>, 'Result matches expected';
36
+ }
37
+ }
38
+ }
31
39
  }
32
40
  } when %case-set<description> ~~ 'allergicTo';
33
41
 
@@ -1,5 +1,5 @@
1
1
  exercise: Allergies
2
- version: 2
2
+ version: 3
3
3
  plan: 4
4
4
  imports: '&allergic-to &list-allergies'
5
5
  tests: |-
@@ -8,7 +8,15 @@ tests: |-
8
8
  subtest 'allergic-to' => {
9
9
  plan 7;
10
10
  for %case-set<cases>.values -> %case {
11
- is allergic-to(%case<score>, .<substance>), .<result>, %case<description> ~ ': ' ~ .<substance> for %case<expected>.values;
11
+ for %case<expected>.values {
12
+ given allergic-to %case<score>, .<substance> -> $result {
13
+ subtest %case<description> ~ ': ' ~ .<substance> => {
14
+ plan 2;
15
+ isa-ok $result, Bool;
16
+ is-deeply $result, .<result>, 'Result matches expected';
17
+ }
18
+ }
19
+ }
12
20
  }
13
21
  } when %case-set<description> ~~ 'allergicTo';
14
22
 
@@ -1,4 +1,4 @@
1
- unit module Leap:ver<2>;
1
+ unit module Leap:ver<3>;
2
2
 
3
3
  sub is-leap-year ($year) is export {
4
4
  is-divisible($year, 400)
@@ -1,4 +1,4 @@
1
- unit module Leap:ver<2>;
1
+ unit module Leap:ver<3>;
2
2
 
3
3
  sub is-leap-year ($year) is export {
4
4
  }
@@ -1,9 +1,17 @@
1
1
  exercise: Leap
2
- version: 2
2
+ version: 3
3
3
  plan: 6
4
4
  imports: '&is-leap-year'
5
5
  tests: |-
6
- is is-leap-year(.<input>), |.<expected description> for @($c-data<cases>);
6
+ for $c-data<cases>.values {
7
+ given is-leap-year .<input> -> $result {
8
+ subtest .<description>, {
9
+ plan 2;
10
+ isa-ok $result, Bool;
11
+ is-deeply $result, .<expected>, 'Result matches expected';
12
+ }
13
+ }
14
+ }
7
15
 
8
16
  unit: module
9
17
  example: |-
@@ -5,7 +5,7 @@ use lib my $dir = $?FILE.IO.dirname;
5
5
  use JSON::Fast;
6
6
 
7
7
  my Str:D $exercise := 'Leap';
8
- my Version:D $version = v2;
8
+ my Version:D $version = v3;
9
9
  my Str $module //= $exercise;
10
10
  plan 6;
11
11
 
@@ -22,7 +22,15 @@ if ::($exercise).^ver !~~ $version {
22
22
  require ::($module) <&is-leap-year>;
23
23
 
24
24
  my $c-data = from-json $=pod.pop.contents;
25
- is is-leap-year(.<input>), |.<expected description> for @($c-data<cases>);
25
+ for $c-data<cases>.values {
26
+ given is-leap-year .<input> -> $result {
27
+ subtest .<description>, {
28
+ plan 2;
29
+ isa-ok $result, Bool;
30
+ is-deeply $result, .<expected>, 'Result matches expected';
31
+ }
32
+ }
33
+ }
26
34
 
27
35
  =head2 Canonical Data
28
36
  =begin code
@@ -1,4 +1,4 @@
1
- unit module Luhn:ver<1>;
1
+ unit module Luhn:ver<2>;
2
2
 
3
3
  sub is-luhn-valid ($input is copy) is export {
4
4
  $input ~~ s:g/\s+//;
@@ -1,4 +1,4 @@
1
- unit module Luhn:ver<1>;
1
+ unit module Luhn:ver<2>;
2
2
 
3
3
  sub is-luhn-valid ($input) is export {
4
4
  }
@@ -1,9 +1,17 @@
1
1
  exercise: Luhn
2
- version: 1
2
+ version: 2
3
3
  plan: 15
4
4
  imports: '&is-luhn-valid'
5
5
  tests: |-
6
- is .<input>.&is-luhn-valid, |.<expected description> for @($c-data<cases>);
6
+ for $c-data<cases>.values {
7
+ given is-luhn-valid .<input> -> $result {
8
+ subtest .<description>, {
9
+ plan 2;
10
+ isa-ok $result, Bool;
11
+ is-deeply $result, .<expected>, 'Result matches expected';
12
+ }
13
+ }
14
+ }
7
15
 
8
16
  unit: module
9
17
  example: |-
@@ -5,7 +5,7 @@ use lib my $dir = $?FILE.IO.dirname;
5
5
  use JSON::Fast;
6
6
 
7
7
  my Str:D $exercise := 'Luhn';
8
- my Version:D $version = v1;
8
+ my Version:D $version = v2;
9
9
  my Str $module //= $exercise;
10
10
  plan 15;
11
11
 
@@ -22,7 +22,15 @@ if ::($exercise).^ver !~~ $version {
22
22
  require ::($module) <&is-luhn-valid>;
23
23
 
24
24
  my $c-data = from-json $=pod.pop.contents;
25
- is .<input>.&is-luhn-valid, |.<expected description> for @($c-data<cases>);
25
+ for $c-data<cases>.values {
26
+ given is-luhn-valid .<input> -> $result {
27
+ subtest .<description>, {
28
+ plan 2;
29
+ isa-ok $result, Bool;
30
+ is-deeply $result, .<expected>, 'Result matches expected';
31
+ }
32
+ }
33
+ }
26
34
 
27
35
  =head2 Canonical Data
28
36
  =begin code