trackler 2.2.1.147 → 2.2.1.148

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/crystal/Makefile +1 -1
  4. data/tracks/crystal/exercises/acronym/spec/acronym_spec.cr +2 -6
  5. data/tracks/crystal/exercises/binary/spec/binary_spec.cr +1 -1
  6. data/tracks/crystal/exercises/difference-of-squares/spec/difference_of_squares_spec.cr +10 -14
  7. data/tracks/crystal/exercises/run-length-encoding/spec/run_length_encoding_spec.cr +29 -9
  8. data/tracks/crystal/generator/src/generators/acronym.cr +1 -1
  9. data/tracks/crystal/generator/src/generators/binary.cr +1 -1
  10. data/tracks/crystal/generator/src/generators/difference_of_squares.cr +6 -7
  11. data/tracks/crystal/generator/src/generators/run_length_encoding.cr +20 -10
  12. data/tracks/csharp/config.json +477 -477
  13. data/tracks/elixir/exercises/largest-series-product/example.exs +1 -1
  14. data/tracks/elm/exercises/phone-number/PhoneNumber.elm +1 -6
  15. data/tracks/elm/exercises/phone-number/tests/Tests.elm +22 -37
  16. data/tracks/elm/exercises/run-length-encoding/tests/Tests.elm +55 -31
  17. data/tracks/fsharp/generators/Exercise.fs +27 -6
  18. data/tracks/fsharp/generators/Generators.fs +37 -45
  19. data/tracks/fsharp/generators/Templates.fs +15 -44
  20. data/tracks/haskell/.travis.yml +1 -0
  21. data/tracks/haskell/bin/check-configlet-fmt.sh +42 -0
  22. data/tracks/haskell/config/maintainers.json +13 -13
  23. data/tracks/haskell/config.json +212 -250
  24. data/tracks/java/exercises/sublist/.meta/version +1 -1
  25. data/tracks/java/exercises/word-search/.meta/version +1 -1
  26. data/tracks/nim/config.json +10 -0
  27. data/tracks/nim/exercises/reverse-string/README.md +13 -0
  28. data/tracks/nim/exercises/reverse-string/example.nim +4 -0
  29. data/tracks/nim/exercises/reverse-string/reverse_string_test.nim +20 -0
  30. data/tracks/objective-c/config.json +10 -0
  31. data/tracks/objective-c/exercises/reverse-string/README.md +34 -0
  32. data/tracks/objective-c/exercises/reverse-string/ReverseStringExample.h +7 -0
  33. data/tracks/objective-c/exercises/reverse-string/ReverseStringExample.m +22 -0
  34. data/tracks/objective-c/exercises/reverse-string/ReverseStringTest.m +51 -0
  35. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.pbxproj +18 -0
  36. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  37. data/tracks/ruby/config/maintainers.json +25 -25
  38. data/tracks/ruby/config.json +203 -371
  39. data/tracks/ruby/exercises/bob/.meta/.version +1 -1
  40. data/tracks/ruby/exercises/bob/.meta/generator/bob_case.rb +3 -2
  41. data/tracks/ruby/exercises/bob/.meta/solutions/bob.rb +3 -1
  42. data/tracks/ruby/exercises/bob/README.md +2 -0
  43. data/tracks/ruby/exercises/bob/bob_test.rb +27 -27
  44. data/tracks/ruby/exercises/hamming/RUNNING_TESTS.md +1 -1
  45. data/tracks/rust/.travis.yml +1 -0
  46. data/tracks/rust/_test/check-configlet-fmt.sh +37 -0
  47. data/tracks/rust/config/maintainers.json +23 -23
  48. data/tracks/rust/config.json +246 -246
  49. metadata +12 -3
  50. data/tracks/elm/exercises/run-length-encoding/RunLengthEncodingPropertyChecks.elm +0 -63
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b61403722ebdf8586671cb971ce56257a201f438
4
- data.tar.gz: 6d88b07bc32fe0c6cd7546ac894e3d2501f68c3a
3
+ metadata.gz: dbab684afe326ddd909b3361ba000477a186b627
4
+ data.tar.gz: 883862a6b7800c61b5210346f40e031c68058c69
5
5
  SHA512:
6
- metadata.gz: 0e10daad4a8cc476dcb11910133aee8d6b1fe49f9ab9cedf939ea94403485490235d8d0189b1cb9de5985490cad689cbf23b08635602306cceacad81e88844bd
7
- data.tar.gz: 4816d57cb9b60dbe25df9356929ff8b26973dd5c74f6b527c804b48251c6fb297ffc51d3c5c9e9a6f94dcabdc6bab1d45423fdce595717c041cddb30ccaf7031
6
+ metadata.gz: 2643b2729030dfedb42b4305ef9e42ff4de1c628f753ff56ae9beb5dc44b71116013f4489396b202ce103c5e62bb0f12334af8fde4305ab60548dc4e5f0d2172
7
+ data.tar.gz: 74c5a67d7a337e2f26c9069634a19eb6804156c3c501b3e5b80d7460eb0fc3da0feb34e20ca2d3728da8c59318c5c652d013e4bb95599fa104e8b731218dddae
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.2.1.147"
2
+ VERSION = "2.2.1.148"
3
3
  end
@@ -13,7 +13,7 @@ TMPSPECFILE := "$(SPECFILE).tmp"
13
13
  GENERATORDIR ?= generator
14
14
  GENERATORBIN := $(GENERATORDIR)/bin
15
15
  GENERATORSDIR := $(GENERATORDIR)/src/generators
16
- GENERATORS = $(shell find $(GENERATORSDIR) -type f | cut -d '/' -f 4 | cut -d '.' -f 1 | sed 's/_/-/g')
16
+ GENERATORS = $(shell find $(GENERATORSDIR) -name '*.cr' | xargs -I '{}' basename '{}' .cr | tr _ -)
17
17
 
18
18
  G_SRCS := $(shell find $(GENERATORDIR) -name "*.cr" -or -name "*.tt" | grep -Ev '(/lib/|/spec/)')
19
19
 
@@ -14,15 +14,11 @@ describe "Acronym" do
14
14
  Acronym.abbreviate("First In, First Out").should eq("FIFO")
15
15
  end
16
16
 
17
- pending "does all caps words" do
18
- Acronym.abbreviate("PHP: Hypertext Preprocessor").should eq("PHP")
19
- end
20
-
21
- pending "does non-acronym all caps word" do
17
+ pending "does all caps word" do
22
18
  Acronym.abbreviate("GNU Image Manipulation Program").should eq("GIMP")
23
19
  end
24
20
 
25
- pending "does hyphenated" do
21
+ pending "does punctuation without whitespace" do
26
22
  Acronym.abbreviate("Complementary metal-oxide semiconductor").should eq("CMOS")
27
23
  end
28
24
  end
@@ -68,7 +68,7 @@ describe "Binary" do
68
68
  end
69
69
  end
70
70
 
71
- pending "a number and a word whitespace spearated is invalid" do
71
+ pending "a number and a word whitespace separated is invalid" do
72
72
  expect_raises(ArgumentError) do
73
73
  Binary.to_decimal("001 nope")
74
74
  end
@@ -2,42 +2,38 @@ require "spec"
2
2
  require "../src/*"
3
3
 
4
4
  describe "DifferenceOfSquares" do
5
- it "calculates square of sum 5 is 225" do
6
- Squares.square_of_sum(5).should eq(225)
5
+ it "calculates square of sum 1 is 1" do
6
+ Squares.square_of_sum(1).should eq(1)
7
7
  end
8
8
 
9
- pending "calculates square of sum 10 is 3025" do
10
- Squares.square_of_sum(10).should eq(3025)
9
+ pending "calculates square of sum 5 is 225" do
10
+ Squares.square_of_sum(5).should eq(225)
11
11
  end
12
12
 
13
13
  pending "calculates square of sum 100 is 25502500" do
14
14
  Squares.square_of_sum(100).should eq(25502500)
15
15
  end
16
16
 
17
- pending "calculates sum of squares 5 is 55" do
18
- Squares.sum_of_squares(5).should eq(55)
17
+ pending "calculates sum of squares 1 is 1" do
18
+ Squares.sum_of_squares(1).should eq(1)
19
19
  end
20
20
 
21
- pending "calculates sum of squares 10 is 385" do
22
- Squares.sum_of_squares(10).should eq(385)
21
+ pending "calculates sum of squares 5 is 55" do
22
+ Squares.sum_of_squares(5).should eq(55)
23
23
  end
24
24
 
25
25
  pending "calculates sum of squares 100 is 338350" do
26
26
  Squares.sum_of_squares(100).should eq(338350)
27
27
  end
28
28
 
29
- pending "calculates difference of squares 0 is 0" do
30
- Squares.difference_of_squares(0).should eq(0)
29
+ pending "calculates difference of squares 1 is 0" do
30
+ Squares.difference_of_squares(1).should eq(0)
31
31
  end
32
32
 
33
33
  pending "calculates difference of squares 5 is 170" do
34
34
  Squares.difference_of_squares(5).should eq(170)
35
35
  end
36
36
 
37
- pending "calculates difference of squares 10 is 2640" do
38
- Squares.difference_of_squares(10).should eq(2640)
39
- end
40
-
41
37
  pending "calculates difference of squares 100 is 25164150" do
42
38
  Squares.difference_of_squares(100).should eq(25164150)
43
39
  end
@@ -6,10 +6,26 @@ describe "RunLengthEncoding" do
6
6
  RunLengthEncoding.encode("").should eq("")
7
7
  end
8
8
 
9
- pending "encode single characters only" do
9
+ pending "encode single characters only are encoded without count" do
10
10
  RunLengthEncoding.encode("XYZ").should eq("XYZ")
11
11
  end
12
12
 
13
+ pending "encode string with no single characters" do
14
+ RunLengthEncoding.encode("AABBBCCCC").should eq("2A3B4C")
15
+ end
16
+
17
+ pending "encode single characters mixed with repeated characters" do
18
+ RunLengthEncoding.encode("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB").should eq("12WB12W3B24WB")
19
+ end
20
+
21
+ pending "encode multiple whitespace mixed in string" do
22
+ RunLengthEncoding.encode(" hsqq qww ").should eq("2 hs2q q2w2 ")
23
+ end
24
+
25
+ pending "encode lowercase characters" do
26
+ RunLengthEncoding.encode("aabbbcccc").should eq("2a3b4c")
27
+ end
28
+
13
29
  pending "decode empty string" do
14
30
  RunLengthEncoding.decode("").should eq("")
15
31
  end
@@ -18,19 +34,23 @@ describe "RunLengthEncoding" do
18
34
  RunLengthEncoding.decode("XYZ").should eq("XYZ")
19
35
  end
20
36
 
21
- pending "encode simple" do
22
- RunLengthEncoding.encode("AABBBCCCC").should eq("2A3B4C")
37
+ pending "decode string with no single characters" do
38
+ RunLengthEncoding.decode("2A3B4C").should eq("AABBBCCCC")
23
39
  end
24
40
 
25
- pending "decode simple" do
26
- RunLengthEncoding.decode("2A3B4C").should eq("AABBBCCCC")
41
+ pending "decode single characters with repeated characters" do
42
+ RunLengthEncoding.decode("12WB12W3B24WB").should eq("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB")
27
43
  end
28
44
 
29
- pending "encode with single values" do
30
- RunLengthEncoding.encode("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB").should eq("12WB12W3B24WB")
45
+ pending "decode multiple whitespace mixed in string" do
46
+ RunLengthEncoding.decode("2 hs2q q2w2 ").should eq(" hsqq qww ")
31
47
  end
32
48
 
33
- pending "decode with single values" do
34
- RunLengthEncoding.decode("12WB12W3B24WB").should eq("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB")
49
+ pending "decode lower case string" do
50
+ RunLengthEncoding.decode("2a3b4c").should eq("aabbbcccc")
51
+ end
52
+
53
+ pending "encode followed by decode gives original string" do
54
+ RunLengthEncoding.decode(RunLengthEncoding.encode("zzz ZZ zZ")).should eq("zzz ZZ zZ")
35
55
  end
36
56
  end
@@ -19,7 +19,7 @@ class AcronymTestCase < ExerciseTestCase
19
19
  private getter expected : JSON::Any
20
20
 
21
21
  def initialize(test_case)
22
- @phrase = test_case["phrase"]
22
+ @phrase = test_case["input"]["phrase"]
23
23
  @description = test_case["description"]
24
24
  @expected = test_case["expected"]
25
25
  end
@@ -19,7 +19,7 @@ class BinaryTestCase < ExerciseTestCase
19
19
  private getter expected : JSON::Any?
20
20
 
21
21
  def initialize(test_case)
22
- @binary = test_case["binary"]
22
+ @binary = test_case["input"]["binary"]
23
23
  @description = test_case["description"]
24
24
  @expected = test_case["expected"]?
25
25
  end
@@ -7,10 +7,9 @@ class DifferenceOfSquaresGenerator < ExerciseGenerator
7
7
  end
8
8
 
9
9
  def test_cases
10
- ["square_of_sum", "sum_of_squares", "difference_of_squares"]
11
- .reduce(Array(ExerciseTestCase).new) do |cases, type|
12
- cases + JSON.parse(data)[type]["cases"].map do |test_case|
13
- DifferenceOfSquaresTestCase.new(test_case, type)
10
+ JSON.parse(data)["cases"].flat_map do |case_group|
11
+ case_group["cases"].map do |test_case|
12
+ DifferenceOfSquaresTestCase.new(test_case)
14
13
  end
15
14
  end
16
15
  end
@@ -22,9 +21,9 @@ class DifferenceOfSquaresTestCase < ExerciseTestCase
22
21
  private getter expected : JSON::Any?
23
22
  private getter type : String
24
23
 
25
- def initialize(test_case, type)
26
- @type = type
27
- @number = test_case["number"]
24
+ def initialize(test_case)
25
+ @type = test_case["property"].as_s.gsub(/([A-Z])/, "_\\1").downcase
26
+ @number = test_case["input"]["number"]
28
27
  @description = test_case["description"]
29
28
  @expected = test_case["expected"]?
30
29
  end
@@ -7,8 +7,14 @@ class RunLengthEncodingGenerator < ExerciseGenerator
7
7
  end
8
8
 
9
9
  def test_cases
10
- JSON.parse(data)["cases"].map do |test_case|
11
- RunLengthEncodingTestCase.new(test_case)
10
+ JSON.parse(data)["cases"].flat_map do |case_group|
11
+ case_group["cases"].map do |test_case|
12
+ if test_case["property"] == "consistency"
13
+ RunLengthEncodingConsistencyTestCase.new(test_case)
14
+ else
15
+ RunLengthEncodingTestCase.new(test_case)
16
+ end
17
+ end
12
18
  end
13
19
  end
14
20
  end
@@ -17,11 +23,13 @@ class RunLengthEncodingTestCase < ExerciseTestCase
17
23
  private getter description : JSON::Any
18
24
  private getter input : JSON::Any
19
25
  private getter expected : JSON::Any
26
+ private getter method : JSON::Any
20
27
 
21
28
  def initialize(test_case)
22
29
  @description = test_case["description"]
23
- @input = test_case["input"]
30
+ @input = test_case["input"]["string"]
24
31
  @expected = test_case["expected"]
32
+ @method = test_case["property"]
25
33
  end
26
34
 
27
35
  def workload
@@ -29,14 +37,16 @@ class RunLengthEncodingTestCase < ExerciseTestCase
29
37
  end
30
38
 
31
39
  def test_name
32
- description
40
+ method.as_s + " " + description.as_s
33
41
  end
42
+ end
34
43
 
35
- private def method
36
- if description.as_s.match(/encode/)
37
- "encode"
38
- else
39
- "decode"
40
- end
44
+ class RunLengthEncodingConsistencyTestCase < RunLengthEncodingTestCase
45
+ def workload
46
+ "RunLengthEncoding.decode(RunLengthEncoding.encode(\"#{input}\")).should eq(\"#{expected}\")"
47
+ end
48
+
49
+ def test_name
50
+ description
41
51
  end
42
52
  end