trackler 2.2.1.147 → 2.2.1.148
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/crystal/Makefile +1 -1
- data/tracks/crystal/exercises/acronym/spec/acronym_spec.cr +2 -6
- data/tracks/crystal/exercises/binary/spec/binary_spec.cr +1 -1
- data/tracks/crystal/exercises/difference-of-squares/spec/difference_of_squares_spec.cr +10 -14
- data/tracks/crystal/exercises/run-length-encoding/spec/run_length_encoding_spec.cr +29 -9
- data/tracks/crystal/generator/src/generators/acronym.cr +1 -1
- data/tracks/crystal/generator/src/generators/binary.cr +1 -1
- data/tracks/crystal/generator/src/generators/difference_of_squares.cr +6 -7
- data/tracks/crystal/generator/src/generators/run_length_encoding.cr +20 -10
- data/tracks/csharp/config.json +477 -477
- data/tracks/elixir/exercises/largest-series-product/example.exs +1 -1
- data/tracks/elm/exercises/phone-number/PhoneNumber.elm +1 -6
- data/tracks/elm/exercises/phone-number/tests/Tests.elm +22 -37
- data/tracks/elm/exercises/run-length-encoding/tests/Tests.elm +55 -31
- data/tracks/fsharp/generators/Exercise.fs +27 -6
- data/tracks/fsharp/generators/Generators.fs +37 -45
- data/tracks/fsharp/generators/Templates.fs +15 -44
- data/tracks/haskell/.travis.yml +1 -0
- data/tracks/haskell/bin/check-configlet-fmt.sh +42 -0
- data/tracks/haskell/config/maintainers.json +13 -13
- data/tracks/haskell/config.json +212 -250
- data/tracks/java/exercises/sublist/.meta/version +1 -1
- data/tracks/java/exercises/word-search/.meta/version +1 -1
- data/tracks/nim/config.json +10 -0
- data/tracks/nim/exercises/reverse-string/README.md +13 -0
- data/tracks/nim/exercises/reverse-string/example.nim +4 -0
- data/tracks/nim/exercises/reverse-string/reverse_string_test.nim +20 -0
- data/tracks/objective-c/config.json +10 -0
- data/tracks/objective-c/exercises/reverse-string/README.md +34 -0
- data/tracks/objective-c/exercises/reverse-string/ReverseStringExample.h +7 -0
- data/tracks/objective-c/exercises/reverse-string/ReverseStringExample.m +22 -0
- data/tracks/objective-c/exercises/reverse-string/ReverseStringTest.m +51 -0
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.pbxproj +18 -0
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- data/tracks/ruby/config/maintainers.json +25 -25
- data/tracks/ruby/config.json +203 -371
- data/tracks/ruby/exercises/bob/.meta/.version +1 -1
- data/tracks/ruby/exercises/bob/.meta/generator/bob_case.rb +3 -2
- data/tracks/ruby/exercises/bob/.meta/solutions/bob.rb +3 -1
- data/tracks/ruby/exercises/bob/README.md +2 -0
- data/tracks/ruby/exercises/bob/bob_test.rb +27 -27
- data/tracks/ruby/exercises/hamming/RUNNING_TESTS.md +1 -1
- data/tracks/rust/.travis.yml +1 -0
- data/tracks/rust/_test/check-configlet-fmt.sh +37 -0
- data/tracks/rust/config/maintainers.json +23 -23
- data/tracks/rust/config.json +246 -246
- metadata +12 -3
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbab684afe326ddd909b3361ba000477a186b627
|
4
|
+
data.tar.gz: 883862a6b7800c61b5210346f40e031c68058c69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2643b2729030dfedb42b4305ef9e42ff4de1c628f753ff56ae9beb5dc44b71116013f4489396b202ce103c5e62bb0f12334af8fde4305ab60548dc4e5f0d2172
|
7
|
+
data.tar.gz: 74c5a67d7a337e2f26c9069634a19eb6804156c3c501b3e5b80d7460eb0fc3da0feb34e20ca2d3728da8c59318c5c652d013e4bb95599fa104e8b731218dddae
|
data/lib/trackler/version.rb
CHANGED
data/tracks/crystal/Makefile
CHANGED
@@ -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) -
|
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
|
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
|
21
|
+
pending "does punctuation without whitespace" do
|
26
22
|
Acronym.abbreviate("Complementary metal-oxide semiconductor").should eq("CMOS")
|
27
23
|
end
|
28
24
|
end
|
@@ -2,42 +2,38 @@ require "spec"
|
|
2
2
|
require "../src/*"
|
3
3
|
|
4
4
|
describe "DifferenceOfSquares" do
|
5
|
-
it "calculates square of sum
|
6
|
-
Squares.square_of_sum(
|
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
|
-
Squares.square_of_sum(
|
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
|
18
|
-
Squares.sum_of_squares(
|
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
|
22
|
-
Squares.sum_of_squares(
|
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
|
30
|
-
Squares.difference_of_squares(
|
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 "
|
22
|
-
RunLengthEncoding.
|
37
|
+
pending "decode string with no single characters" do
|
38
|
+
RunLengthEncoding.decode("2A3B4C").should eq("AABBBCCCC")
|
23
39
|
end
|
24
40
|
|
25
|
-
pending "decode
|
26
|
-
RunLengthEncoding.decode("
|
41
|
+
pending "decode single characters with repeated characters" do
|
42
|
+
RunLengthEncoding.decode("12WB12W3B24WB").should eq("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB")
|
27
43
|
end
|
28
44
|
|
29
|
-
pending "
|
30
|
-
RunLengthEncoding.
|
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
|
34
|
-
RunLengthEncoding.decode("
|
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
|
-
["
|
11
|
-
.
|
12
|
-
|
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
|
26
|
-
@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"].
|
11
|
-
|
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
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|