trackler 2.1.0.23 → 2.1.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/ceylon/LICENSE +2 -2
- data/tracks/ceylon/README.md +0 -5
- data/tracks/ecmascript/.editorconfig +7 -0
- data/tracks/ecmascript/Makefile +8 -0
- data/tracks/ecmascript/bin/md5-hash +21 -0
- data/tracks/ecmascript/exercises/connect/package.json +3 -3
- data/tracks/elixir/exercises/atbash-cipher/{atbash.exs → atbash_cipher.exs} +4 -0
- data/tracks/elixir/exercises/atbash-cipher/atbash_cipher_test.exs +29 -1
- data/tracks/elixir/exercises/atbash-cipher/example.exs +12 -6
- data/tracks/elixir/exercises/phone-number/example.exs +71 -29
- data/tracks/elixir/exercises/phone-number/phone_number.exs +22 -10
- data/tracks/elixir/exercises/phone-number/phone_number_test.exs +37 -12
- data/tracks/elm/.github/stale.yml +0 -0
- data/tracks/elm/.gitignore +1 -0
- data/tracks/elm/.travis.yml +20 -1
- data/tracks/elm/README.md +9 -20
- data/tracks/elm/bin/build.sh +15 -18
- data/tracks/elm/bin/install-elm-format +1 -1
- data/tracks/elm/config.json +172 -167
- data/tracks/elm/exercises/accumulate/elm-package.json +1 -3
- data/tracks/elm/exercises/accumulate/package.json +3 -3
- data/tracks/elm/exercises/accumulate/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/accumulate/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/allergies/elm-package.json +2 -3
- data/tracks/elm/exercises/allergies/package.json +3 -3
- data/tracks/elm/exercises/allergies/{Tests.elm → tests/Tests.elm} +2 -12
- data/tracks/elm/exercises/allergies/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/anagram/elm-package.json +2 -3
- data/tracks/elm/exercises/anagram/package.json +3 -3
- data/tracks/elm/exercises/anagram/{Tests.elm → tests/Tests.elm} +4 -14
- data/tracks/elm/exercises/anagram/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/atbash-cipher/elm-package.json +2 -3
- data/tracks/elm/exercises/atbash-cipher/package.json +3 -3
- data/tracks/elm/exercises/atbash-cipher/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/atbash-cipher/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/bob/elm-package.json +2 -3
- data/tracks/elm/exercises/bob/package.json +3 -3
- data/tracks/elm/exercises/bob/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/bob/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/difference-of-squares/elm-package.json +2 -3
- data/tracks/elm/exercises/difference-of-squares/package.json +3 -3
- data/tracks/elm/exercises/difference-of-squares/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/difference-of-squares/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/gigasecond/elm-package.json +2 -3
- data/tracks/elm/exercises/gigasecond/package.json +3 -3
- data/tracks/elm/exercises/gigasecond/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/gigasecond/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/grade-school/elm-package.json +2 -3
- data/tracks/elm/exercises/grade-school/package.json +3 -3
- data/tracks/elm/exercises/grade-school/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/grade-school/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/grains/Grains.elm +2 -0
- data/tracks/elm/exercises/grains/Grains.example.elm +9 -0
- data/tracks/elm/exercises/grains/elm-package.json +14 -0
- data/tracks/elm/exercises/grains/package.json +13 -0
- data/tracks/elm/exercises/grains/tests/Tests.elm +38 -0
- data/tracks/elm/exercises/grains/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/hamming/elm-package.json +2 -3
- data/tracks/elm/exercises/hamming/package.json +3 -3
- data/tracks/elm/exercises/hamming/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/hamming/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/hello-world/elm-package.json +2 -3
- data/tracks/elm/exercises/hello-world/package.json +3 -3
- data/tracks/elm/exercises/hello-world/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/hello-world/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/largest-series-product/elm-package.json +2 -3
- data/tracks/elm/exercises/largest-series-product/package.json +3 -3
- data/tracks/elm/exercises/largest-series-product/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/largest-series-product/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/leap/elm-package.json +2 -3
- data/tracks/elm/exercises/leap/package.json +3 -3
- data/tracks/elm/exercises/leap/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/leap/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/list-ops/elm-package.json +2 -3
- data/tracks/elm/exercises/list-ops/package.json +3 -3
- data/tracks/elm/exercises/list-ops/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/list-ops/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/nucleotide-count/elm-package.json +2 -3
- data/tracks/elm/exercises/nucleotide-count/package.json +3 -3
- data/tracks/elm/exercises/nucleotide-count/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/nucleotide-count/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/pangram/elm-package.json +2 -3
- data/tracks/elm/exercises/pangram/package.json +3 -3
- data/tracks/elm/exercises/pangram/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/pangram/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/phone-number/elm-package.json +2 -3
- data/tracks/elm/exercises/phone-number/package.json +3 -3
- data/tracks/elm/exercises/phone-number/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/phone-number/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/raindrops/elm-package.json +2 -3
- data/tracks/elm/exercises/raindrops/package.json +3 -3
- data/tracks/elm/exercises/raindrops/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/raindrops/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/rna-transcription/elm-package.json +2 -3
- data/tracks/elm/exercises/rna-transcription/package.json +3 -3
- data/tracks/elm/exercises/rna-transcription/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/rna-transcription/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/robot-simulator/elm-package.json +2 -3
- data/tracks/elm/exercises/robot-simulator/package.json +3 -3
- data/tracks/elm/exercises/robot-simulator/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/robot-simulator/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/roman-numerals/elm-package.json +2 -3
- data/tracks/elm/exercises/roman-numerals/package.json +3 -3
- data/tracks/elm/exercises/roman-numerals/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/roman-numerals/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/run-length-encoding/elm-package.json +2 -3
- data/tracks/elm/exercises/run-length-encoding/package.json +3 -3
- data/tracks/elm/exercises/run-length-encoding/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/run-length-encoding/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/say/elm-package.json +2 -3
- data/tracks/elm/exercises/say/package.json +3 -3
- data/tracks/elm/exercises/say/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/say/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/scrabble-score/elm-package.json +2 -3
- data/tracks/elm/exercises/scrabble-score/package.json +3 -3
- data/tracks/elm/exercises/scrabble-score/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/scrabble-score/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/series/elm-package.json +2 -3
- data/tracks/elm/exercises/series/package.json +3 -3
- data/tracks/elm/exercises/series/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/series/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/space-age/elm-package.json +2 -3
- data/tracks/elm/exercises/space-age/package.json +3 -3
- data/tracks/elm/exercises/space-age/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/space-age/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/strain/elm-package.json +2 -3
- data/tracks/elm/exercises/strain/package.json +3 -3
- data/tracks/elm/exercises/strain/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/strain/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/sublist/elm-package.json +2 -3
- data/tracks/elm/exercises/sublist/package.json +3 -3
- data/tracks/elm/exercises/sublist/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/sublist/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/sum-of-multiples/elm-package.json +2 -3
- data/tracks/elm/exercises/sum-of-multiples/package.json +3 -3
- data/tracks/elm/exercises/sum-of-multiples/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/sum-of-multiples/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/triangle/elm-package.json +2 -3
- data/tracks/elm/exercises/triangle/package.json +3 -3
- data/tracks/elm/exercises/triangle/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/triangle/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/word-count/elm-package.json +2 -3
- data/tracks/elm/exercises/word-count/package.json +3 -3
- data/tracks/elm/exercises/word-count/{Tests.elm → tests/Tests.elm} +1 -11
- data/tracks/elm/exercises/word-count/tests/elm-package.json +16 -0
- data/tracks/elm/package.json +2 -2
- data/tracks/java/exercises/clock/HINT.md +3 -0
- data/tracks/java/exercises/clock/src/test/java/ClockAddTest.java +3 -0
- data/tracks/java/exercises/clock/src/test/java/ClockCreationTest.java +3 -0
- data/tracks/java/exercises/clock/src/test/java/ClockEqualTest.java +21 -17
- data/tracks/java/exercises/simple-linked-list/src/example/java/SimpleLinkedList.java +13 -13
- data/tracks/java/exercises/sublist/src/example/java/RelationshipComputer.java +1 -1
- data/tracks/java/exercises/sublist/src/main/java/RelationshipComputer.java +1 -1
- data/tracks/perl5/docs/TESTS.md +2 -2
- data/tracks/ruby/LICENSE +2 -2
- data/tracks/ruby/README.md +0 -5
- data/tracks/typescript/LICENSE +2 -2
- data/tracks/typescript/README.md +0 -5
- data/tracks/vimscript/README.md +1 -0
- data/tracks/vimscript/TRACK_HINTS.md +26 -1
- data/tracks/vimscript/config.json +15 -0
- data/tracks/vimscript/docs/ABOUT.md +1 -1
- data/tracks/vimscript/exercises/nucleotide-count/example.vim +18 -0
- data/tracks/vimscript/exercises/nucleotide-count/nucleotide_count.vader +38 -0
- data/tracks/vimscript/exercises/nucleotide-count/nucleotide_count.vim +16 -0
- data/tracks/vimscript/exercises/phone-number/example.vim +4 -0
- data/tracks/vimscript/exercises/phone-number/phone_number.vader +36 -0
- data/tracks/vimscript/exercises/phone-number/phone_number.vim +11 -0
- data/tracks/vimscript/exercises/roman-numerals/example.vim +29 -0
- data/tracks/vimscript/exercises/roman-numerals/roman_numerals.vader +53 -0
- data/tracks/vimscript/exercises/roman-numerals/roman_numerals.vim +14 -0
- metadata +81 -35
- data/tracks/elm/elm-package.json +0 -46
- data/tracks/elm/exercises/hello-world/yarn.lock +0 -1136
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"version": "3.0.0",
|
3
|
+
"summary": "Exercism problems in Elm.",
|
4
|
+
"repository": "https://github.com/exercism/xelm.git",
|
5
|
+
"license": "BSD3",
|
6
|
+
"source-directories": [
|
7
|
+
".",
|
8
|
+
".."
|
9
|
+
],
|
10
|
+
"exposed-modules": [],
|
11
|
+
"dependencies": {
|
12
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
13
|
+
"elm-community/elm-test": "4.0.0 <= v < 5.0.0"
|
14
|
+
},
|
15
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
|
+
}
|
@@ -8,9 +8,8 @@
|
|
8
8
|
],
|
9
9
|
"exposed-modules": [],
|
10
10
|
"dependencies": {
|
11
|
-
"elm-lang/core": "5.0.0 <= v < 6.0.0"
|
12
|
-
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
|
13
|
-
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
|
11
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0"
|
14
12
|
},
|
15
13
|
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
14
|
}
|
15
|
+
|
@@ -4,10 +4,10 @@
|
|
4
4
|
"license": "MIT",
|
5
5
|
"scripts": {
|
6
6
|
"postinstall": "elm-package install -y",
|
7
|
-
"test": "elm-test
|
7
|
+
"test": "elm-test"
|
8
8
|
},
|
9
9
|
"dependencies": {
|
10
|
-
"elm": "
|
11
|
-
"elm-test": "
|
10
|
+
"elm": "0.18.0",
|
11
|
+
"elm-test": "0.18.3"
|
12
12
|
}
|
13
13
|
}
|
@@ -1,7 +1,5 @@
|
|
1
|
-
|
1
|
+
module Tests exposing (..)
|
2
2
|
|
3
|
-
import Test.Runner.Node exposing (run, TestProgram)
|
4
|
-
import Json.Encode exposing (Value)
|
5
3
|
import Test exposing (..)
|
6
4
|
import Expect
|
7
5
|
import Sublist exposing (version, sublist, ListComparison(..))
|
@@ -49,11 +47,3 @@ tests =
|
|
49
47
|
, test "recurring values unequal" <|
|
50
48
|
\() -> Expect.equal Unequal (sublist [ 1, 2, 1, 2, 3 ] [ 1, 2, 3, 1, 2, 3, 2, 3, 2, 1 ])
|
51
49
|
]
|
52
|
-
|
53
|
-
|
54
|
-
main : TestProgram
|
55
|
-
main =
|
56
|
-
run emit tests
|
57
|
-
|
58
|
-
|
59
|
-
port emit : ( String, Value ) -> Cmd msg
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"version": "3.0.0",
|
3
|
+
"summary": "Exercism problems in Elm.",
|
4
|
+
"repository": "https://github.com/exercism/xelm.git",
|
5
|
+
"license": "BSD3",
|
6
|
+
"source-directories": [
|
7
|
+
".",
|
8
|
+
".."
|
9
|
+
],
|
10
|
+
"exposed-modules": [],
|
11
|
+
"dependencies": {
|
12
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
13
|
+
"elm-community/elm-test": "4.0.0 <= v < 5.0.0"
|
14
|
+
},
|
15
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
|
+
}
|
@@ -8,9 +8,8 @@
|
|
8
8
|
],
|
9
9
|
"exposed-modules": [],
|
10
10
|
"dependencies": {
|
11
|
-
"elm-lang/core": "5.0.0 <= v < 6.0.0"
|
12
|
-
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
|
13
|
-
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
|
11
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0"
|
14
12
|
},
|
15
13
|
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
14
|
}
|
15
|
+
|
@@ -4,10 +4,10 @@
|
|
4
4
|
"license": "MIT",
|
5
5
|
"scripts": {
|
6
6
|
"postinstall": "elm-package install -y",
|
7
|
-
"test": "elm-test
|
7
|
+
"test": "elm-test"
|
8
8
|
},
|
9
9
|
"dependencies": {
|
10
|
-
"elm": "
|
11
|
-
"elm-test": "
|
10
|
+
"elm": "0.18.0",
|
11
|
+
"elm-test": "0.18.3"
|
12
12
|
}
|
13
13
|
}
|
@@ -1,7 +1,5 @@
|
|
1
|
-
|
1
|
+
module Tests exposing (..)
|
2
2
|
|
3
|
-
import Test.Runner.Node exposing (run, TestProgram)
|
4
|
-
import Json.Encode exposing (Value)
|
5
3
|
import Test exposing (..)
|
6
4
|
import Expect
|
7
5
|
import SumOfMultiples exposing (sumOfMultiples)
|
@@ -23,11 +21,3 @@ tests =
|
|
23
21
|
, test "[5, 25] 51" <|
|
24
22
|
\() -> Expect.equal 275 (sumOfMultiples [ 5, 25 ] 51)
|
25
23
|
]
|
26
|
-
|
27
|
-
|
28
|
-
main : TestProgram
|
29
|
-
main =
|
30
|
-
run emit tests
|
31
|
-
|
32
|
-
|
33
|
-
port emit : ( String, Value ) -> Cmd msg
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"version": "3.0.0",
|
3
|
+
"summary": "Exercism problems in Elm.",
|
4
|
+
"repository": "https://github.com/exercism/xelm.git",
|
5
|
+
"license": "BSD3",
|
6
|
+
"source-directories": [
|
7
|
+
".",
|
8
|
+
".."
|
9
|
+
],
|
10
|
+
"exposed-modules": [],
|
11
|
+
"dependencies": {
|
12
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
13
|
+
"elm-community/elm-test": "4.0.0 <= v < 5.0.0"
|
14
|
+
},
|
15
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
|
+
}
|
@@ -8,9 +8,8 @@
|
|
8
8
|
],
|
9
9
|
"exposed-modules": [],
|
10
10
|
"dependencies": {
|
11
|
-
"elm-lang/core": "5.0.0 <= v < 6.0.0"
|
12
|
-
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
|
13
|
-
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
|
11
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0"
|
14
12
|
},
|
15
13
|
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
14
|
}
|
15
|
+
|
@@ -4,10 +4,10 @@
|
|
4
4
|
"license": "MIT",
|
5
5
|
"scripts": {
|
6
6
|
"postinstall": "elm-package install -y",
|
7
|
-
"test": "elm-test
|
7
|
+
"test": "elm-test"
|
8
8
|
},
|
9
9
|
"dependencies": {
|
10
|
-
"elm": "
|
11
|
-
"elm-test": "
|
10
|
+
"elm": "0.18.0",
|
11
|
+
"elm-test": "0.18.3"
|
12
12
|
}
|
13
13
|
}
|
@@ -1,7 +1,5 @@
|
|
1
|
-
|
1
|
+
module Tests exposing (..)
|
2
2
|
|
3
|
-
import Test.Runner.Node exposing (run, TestProgram)
|
4
|
-
import Json.Encode exposing (Value)
|
5
3
|
import Test exposing (..)
|
6
4
|
import Expect
|
7
5
|
import Triangle exposing (triangleKind, Triangle(..))
|
@@ -39,11 +37,3 @@ tests =
|
|
39
37
|
, test "triangles violating triangle inequality are illegal 2" <|
|
40
38
|
\() -> Expect.equal (Err "Violates inequality") (triangleKind 7 3 2)
|
41
39
|
]
|
42
|
-
|
43
|
-
|
44
|
-
main : TestProgram
|
45
|
-
main =
|
46
|
-
run emit tests
|
47
|
-
|
48
|
-
|
49
|
-
port emit : ( String, Value ) -> Cmd msg
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"version": "3.0.0",
|
3
|
+
"summary": "Exercism problems in Elm.",
|
4
|
+
"repository": "https://github.com/exercism/xelm.git",
|
5
|
+
"license": "BSD3",
|
6
|
+
"source-directories": [
|
7
|
+
".",
|
8
|
+
".."
|
9
|
+
],
|
10
|
+
"exposed-modules": [],
|
11
|
+
"dependencies": {
|
12
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
13
|
+
"elm-community/elm-test": "4.0.0 <= v < 5.0.0"
|
14
|
+
},
|
15
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
|
+
}
|
@@ -8,9 +8,8 @@
|
|
8
8
|
],
|
9
9
|
"exposed-modules": [],
|
10
10
|
"dependencies": {
|
11
|
-
"elm-lang/core": "5.0.0 <= v < 6.0.0"
|
12
|
-
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
|
13
|
-
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
|
11
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0"
|
14
12
|
},
|
15
13
|
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
14
|
}
|
15
|
+
|
@@ -4,10 +4,10 @@
|
|
4
4
|
"license": "MIT",
|
5
5
|
"scripts": {
|
6
6
|
"postinstall": "elm-package install -y",
|
7
|
-
"test": "elm-test
|
7
|
+
"test": "elm-test"
|
8
8
|
},
|
9
9
|
"dependencies": {
|
10
|
-
"elm": "
|
11
|
-
"elm-test": "
|
10
|
+
"elm": "0.18.0",
|
11
|
+
"elm-test": "0.18.3"
|
12
12
|
}
|
13
13
|
}
|
@@ -1,7 +1,5 @@
|
|
1
|
-
|
1
|
+
module Tests exposing (..)
|
2
2
|
|
3
|
-
import Test.Runner.Node exposing (run, TestProgram)
|
4
|
-
import Json.Encode exposing (Value)
|
5
3
|
import Test exposing (..)
|
6
4
|
import Expect
|
7
5
|
import Dict exposing (Dict)
|
@@ -36,11 +34,3 @@ tests =
|
|
36
34
|
Expect.equal [ ( "go", 3 ), ( "stop", 2 ) ]
|
37
35
|
(wordCount "go Go GO Stop stop" |> Dict.toList)
|
38
36
|
]
|
39
|
-
|
40
|
-
|
41
|
-
main : TestProgram
|
42
|
-
main =
|
43
|
-
run emit tests
|
44
|
-
|
45
|
-
|
46
|
-
port emit : ( String, Value ) -> Cmd msg
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"version": "3.0.0",
|
3
|
+
"summary": "Exercism problems in Elm.",
|
4
|
+
"repository": "https://github.com/exercism/xelm.git",
|
5
|
+
"license": "BSD3",
|
6
|
+
"source-directories": [
|
7
|
+
".",
|
8
|
+
".."
|
9
|
+
],
|
10
|
+
"exposed-modules": [],
|
11
|
+
"dependencies": {
|
12
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
13
|
+
"elm-community/elm-test": "4.0.0 <= v < 5.0.0"
|
14
|
+
},
|
15
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
|
+
}
|
data/tracks/elm/package.json
CHANGED
@@ -0,0 +1,3 @@
|
|
1
|
+
In order to satisfy the requirement that two clocks are considered equal just when they are set to the same time, you will need to override the [`equals`](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object)) and [`hashcode`](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode) methods in your `Clock` class.
|
2
|
+
|
3
|
+
For more information on how to override these methods, see [this JavaWorld article](https://web.archive.org/web/20170528222153/http://www.javaworld.com/article/2072762/java-app-dev/object-equality.html).
|
@@ -1,98 +1,102 @@
|
|
1
1
|
import org.junit.Ignore;
|
2
2
|
import org.junit.Test;
|
3
3
|
|
4
|
-
import static org.junit.Assert.
|
5
|
-
import static org.junit.Assert.
|
4
|
+
import static org.junit.Assert.assertNotEquals;
|
5
|
+
import static org.junit.Assert.assertEquals;
|
6
6
|
|
7
|
+
/*
|
8
|
+
* version: 1.0.1
|
9
|
+
*/
|
7
10
|
public class ClockEqualTest {
|
8
11
|
|
9
12
|
@Ignore("Remove to run test")
|
10
13
|
@Test
|
11
14
|
public void clocksWithSameTimeAreEqual() {
|
12
|
-
|
15
|
+
assertEquals(new Clock(15, 37), new Clock(15, 37));
|
13
16
|
}
|
14
17
|
|
15
18
|
@Ignore("Remove to run test")
|
16
19
|
@Test
|
17
20
|
public void clocksAMinuteApartAreNotEqual() {
|
18
|
-
|
21
|
+
assertNotEquals(new Clock(15, 36), new Clock(15, 37));
|
19
22
|
}
|
20
23
|
|
21
24
|
@Ignore("Remove to run test")
|
22
25
|
@Test
|
23
26
|
public void clocksAnHourApartAreNotEqual() {
|
24
|
-
|
27
|
+
assertNotEquals(new Clock(14, 37), new Clock(15, 37));
|
25
28
|
}
|
26
29
|
|
27
30
|
@Ignore("Remove to run test")
|
28
31
|
@Test
|
29
32
|
public void clocksWithHourOverflow() {
|
30
|
-
|
33
|
+
assertEquals(new Clock(10, 37), new Clock(34, 37));
|
31
34
|
}
|
32
35
|
|
33
36
|
@Ignore("Remove to run test")
|
34
37
|
@Test
|
35
38
|
public void clocksWithHourOverflowBySeveralDays() {
|
36
|
-
|
39
|
+
assertEquals(new Clock(3, 11), new Clock(99, 11));
|
37
40
|
}
|
38
41
|
|
39
42
|
@Ignore("Remove to run test")
|
40
43
|
@Test
|
41
44
|
public void clocksWithNegateHour() {
|
42
|
-
|
45
|
+
assertEquals(new Clock(22, 40), new Clock(-2, 40));
|
43
46
|
}
|
44
47
|
|
45
48
|
@Ignore("Remove to run test")
|
46
49
|
@Test
|
47
50
|
public void clocksWithNegativeHourThatWraps() {
|
48
|
-
|
51
|
+
assertEquals(new Clock(17, 3), new Clock(-31, 3));
|
49
52
|
}
|
50
53
|
|
51
54
|
@Ignore("Remove to run test")
|
52
55
|
@Test
|
53
56
|
public void clocksWithNegativeHourThatWrapsMultipleTimes() {
|
54
|
-
|
57
|
+
assertEquals(new Clock(13, 49), new Clock(-83, 49));
|
55
58
|
}
|
56
59
|
|
57
60
|
@Ignore("Remove to run test")
|
58
61
|
@Test
|
59
62
|
public void clocksWithMinuteOverflow() {
|
60
|
-
|
63
|
+
assertEquals(new Clock(0, 1), new Clock(0, 1441));
|
61
64
|
}
|
62
65
|
|
63
66
|
@Ignore("Remove to run test")
|
64
67
|
@Test
|
65
68
|
public void clocksWithMinuteOverflowBySeveralDays() {
|
66
|
-
|
69
|
+
assertEquals(new Clock(2, 2), new Clock(2, 4322));
|
67
70
|
}
|
68
71
|
|
69
72
|
@Ignore("Remove to run test")
|
70
73
|
@Test
|
71
74
|
public void clocksWithNegativeMinutes() {
|
72
|
-
|
75
|
+
assertEquals(new Clock(2, 40), new Clock(3, -20));
|
73
76
|
}
|
74
77
|
|
75
78
|
@Ignore("Remove to run test")
|
76
79
|
@Test
|
77
80
|
public void clocksWithNegativeMinutesThatWraps() {
|
78
|
-
|
81
|
+
assertEquals(new Clock(4, 10), new Clock(5, -1490));
|
79
82
|
}
|
80
83
|
|
81
84
|
@Ignore("Remove to run test")
|
82
85
|
@Test
|
83
86
|
public void clocksWithNegativeMinutesThatWrapsMultipleTimes() {
|
84
|
-
|
87
|
+
assertEquals(new Clock(6, 15), new Clock(6, -4305));
|
85
88
|
}
|
86
89
|
|
87
90
|
@Ignore("Remove to run test")
|
88
91
|
@Test
|
89
92
|
public void clocksWithNegativeHoursAndMinutes() {
|
90
|
-
|
93
|
+
assertEquals(new Clock(7, 32), new Clock(-12, -268));
|
91
94
|
}
|
92
95
|
|
93
96
|
@Ignore("Remove to run test")
|
94
97
|
@Test
|
95
98
|
public void clocksWithNegativeHoursAndMinutesThatWrap() {
|
96
|
-
|
99
|
+
assertEquals(new Clock(18, 7), new Clock(-54, -11513));
|
97
100
|
}
|
101
|
+
|
98
102
|
}
|
@@ -3,12 +3,12 @@ import java.lang.reflect.Array;
|
|
3
3
|
import java.util.NoSuchElementException;
|
4
4
|
import java.util.Objects;
|
5
5
|
|
6
|
-
|
6
|
+
class SimpleLinkedList<T> {
|
7
7
|
|
8
8
|
private static class Element<T> {
|
9
9
|
|
10
10
|
final T value;
|
11
|
-
Element next;
|
11
|
+
Element<T> next;
|
12
12
|
|
13
13
|
Element(T value) {
|
14
14
|
this.value = value;
|
@@ -18,16 +18,16 @@ public class SimpleLinkedList<T> {
|
|
18
18
|
private Element<T> head;
|
19
19
|
private int size;
|
20
20
|
|
21
|
-
|
21
|
+
SimpleLinkedList() {
|
22
22
|
}
|
23
23
|
|
24
|
-
|
25
|
-
for (int
|
26
|
-
push(values[
|
24
|
+
SimpleLinkedList(T[] values) {
|
25
|
+
for (int i = values.length - 1; i >= 0; i--) {
|
26
|
+
push(values[i]);
|
27
27
|
}
|
28
28
|
}
|
29
29
|
|
30
|
-
|
30
|
+
final void push(T value) {
|
31
31
|
Element<T> newElement = new Element<>(value);
|
32
32
|
this.size++;
|
33
33
|
if (Objects.isNull(head)) {
|
@@ -38,7 +38,7 @@ public class SimpleLinkedList<T> {
|
|
38
38
|
}
|
39
39
|
}
|
40
40
|
|
41
|
-
|
41
|
+
T pop() {
|
42
42
|
if (Objects.isNull(head)) {
|
43
43
|
throw new NoSuchElementException();
|
44
44
|
}
|
@@ -48,7 +48,7 @@ public class SimpleLinkedList<T> {
|
|
48
48
|
return value;
|
49
49
|
}
|
50
50
|
|
51
|
-
|
51
|
+
void reverse() {
|
52
52
|
Element<T> current = head;
|
53
53
|
Element<T> next;
|
54
54
|
Element<T> previous = null;
|
@@ -61,8 +61,8 @@ public class SimpleLinkedList<T> {
|
|
61
61
|
head = previous;
|
62
62
|
}
|
63
63
|
|
64
|
-
|
65
|
-
T[] result = newArray(clazz,
|
64
|
+
T[] asArray(Class<T> clazz) {
|
65
|
+
T[] result = newArray(clazz, size);
|
66
66
|
int index = 0;
|
67
67
|
Element<T> current = head;
|
68
68
|
while (Objects.nonNull(current)) {
|
@@ -72,14 +72,14 @@ public class SimpleLinkedList<T> {
|
|
72
72
|
return result;
|
73
73
|
}
|
74
74
|
|
75
|
-
private
|
75
|
+
private T[] newArray(Class<T> clazz, int size) {
|
76
76
|
@SuppressWarnings("unchecked")
|
77
77
|
T[] arr = (T[]) Array.newInstance(clazz, size);
|
78
78
|
|
79
79
|
return arr;
|
80
80
|
}
|
81
81
|
|
82
|
-
|
82
|
+
int size() {
|
83
83
|
return this.size;
|
84
84
|
}
|
85
85
|
}
|