trackler 2.2.1.102 → 2.2.1.103
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/problem-specifications/exercises/two-fer/metadata.yml +0 -1
- data/tracks/c/exercises/bob/.meta/description.md +10 -0
- data/tracks/cfml/exercises/acronym/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/anagram/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/atbash-cipher/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/bob/.meta/description.md +10 -0
- data/tracks/cfml/exercises/bob/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/diamond/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/difference-of-squares/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/flatten-array/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/gigasecond/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/grains/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/hamming/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/isogram/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/largest-series-product/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/luhn/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/markdown/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/nth-prime/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/pangram/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/pig-latin/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/raindrops/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/rna-transcription/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/saddle-points/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/scrabble-score/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/secret-handshake/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/space-age/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/sum-of-multiples/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/triangle/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/cfml/exercises/word-count/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/coffeescript/exercises/bob/.meta/description.md +10 -0
- data/tracks/common-lisp/exercises/bob/.meta/description.md +10 -0
- data/tracks/cpp/exercises/bob/.meta/description.md +10 -0
- data/tracks/crystal/exercises/triangle/README.md +52 -0
- data/tracks/csharp/exercises/complex-numbers/README.md +44 -0
- data/tracks/d/exercises/bob/.meta/description.md +10 -0
- data/tracks/dart/exercises/bob/.meta/description.md +10 -0
- data/tracks/dart/exercises/bob/README.md +0 -1
- data/tracks/ecmascript/exercises/bob/.meta/description.md +10 -0
- data/tracks/ecmascript/exercises/bob/README.md +1 -1
- data/tracks/elisp/config/exercise_readme.go.tmpl +0 -3
- data/tracks/elm/exercises/bob/.meta/description.md +10 -0
- data/tracks/elm/exercises/collatz-conjecture/README.md +63 -0
- data/tracks/erlang/exercises/bob/.meta/description.md +10 -0
- data/tracks/erlang/exercises/complex-numbers/{HINTS.md → .meta/hints.md} +0 -0
- data/tracks/erlang/exercises/robot-simulator/{HINTS.md → .meta/hints.md} +0 -0
- data/tracks/fortran/config/exercise_readme.go.tmpl +0 -3
- data/tracks/fsharp/exercises/clock/ClockTest.fs +9 -9
- data/tracks/fsharp/exercises/kindergarten-garden/KindergartenGardenTest.fs +1 -1
- data/tracks/fsharp/exercises/ocr-numbers/OcrNumbersTest.fs +35 -35
- data/tracks/fsharp/exercises/palindrome-products/PalindromeProductsTest.fs +1 -1
- data/tracks/fsharp/exercises/poker/PokerTest.fs +57 -57
- data/tracks/fsharp/exercises/prime-factors/PrimeFactorsTest.fs +1 -1
- data/tracks/fsharp/exercises/protein-translation/ProteinTranslationTest.fs +1 -1
- data/tracks/fsharp/exercises/proverb/ProverbTest.fs +13 -13
- data/tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs +1 -1
- data/tracks/fsharp/exercises/rail-fence-cipher/RailFenceCipherTest.fs +1 -1
- data/tracks/fsharp/exercises/raindrops/RaindropsTest.fs +1 -1
- data/tracks/fsharp/exercises/rectangles/RectanglesTest.fs +70 -70
- data/tracks/fsharp/exercises/reverse-string/ReverseStringTest.fs +1 -1
- data/tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs +1 -1
- data/tracks/fsharp/exercises/roman-numerals/RomanNumeralsTest.fs +5 -1
- data/tracks/fsharp/exercises/run-length-encoding/RunLengthEncodingTest.fs +1 -1
- data/tracks/fsharp/exercises/word-count/Example.fs +1 -1
- data/tracks/fsharp/exercises/word-count/WordCount.fs +1 -1
- data/tracks/fsharp/exercises/word-count/WordCountTest.fs +12 -12
- data/tracks/fsharp/generators/Generators.fs +26 -40
- data/tracks/gnu-apl/config/exercise_readme.go.tmpl +0 -3
- data/tracks/go/exercises/armstrong-numbers/README.md +36 -0
- data/tracks/go/exercises/two-bucket/.meta/hints.md +23 -3
- data/tracks/go/exercises/two-bucket/README.md +23 -3
- data/tracks/go/exercises/two-bucket/bonus_test.go +22 -0
- data/tracks/go/exercises/two-bucket/example.go +9 -5
- data/tracks/go/exercises/two-bucket/two_bucket_test.go +31 -27
- data/tracks/haxe/config/exercise_readme.go.tmpl +0 -3
- data/tracks/haxe/exercises/leap/README.md +33 -0
- data/tracks/java/exercises/parallel-letter-frequency/.meta/{HINTS.md → hints.md} +0 -0
- data/tracks/java/exercises/protein-translation/README.md +2 -2
- data/tracks/lfe/exercises/bob/.meta/description.md +10 -0
- data/tracks/nim/config/exercise_readme.go.tmpl +0 -3
- data/tracks/objective-c/exercises/collatz-conjecture/README.md +50 -0
- data/tracks/objective-c/exercises/grains/README.md +50 -0
- data/tracks/objective-c/exercises/nth-prime/README.md +32 -0
- data/tracks/objective-c/exercises/say/README.md +86 -0
- data/tracks/objective-c/exercises/two-fer/README.md +36 -0
- data/tracks/php/exercises/collatz-conjecture/README.md +48 -0
- data/tracks/php/exercises/crypto-square/README.md +91 -0
- data/tracks/php/exercises/flatten-array/README.md +32 -0
- data/tracks/php/exercises/transpose/README.md +80 -0
- data/tracks/plsql/exercises/hello-world/README.md +41 -0
- data/tracks/powershell/config/exercise_readme.go.tmpl +0 -3
- data/tracks/prolog/config/exercise_readme.go.tmpl +0 -3
- data/tracks/python/exercises/bowling/README.md +92 -0
- data/tracks/r/config.json +12 -1
- data/tracks/r/exercises/bob/.meta/description.md +10 -0
- data/tracks/r/exercises/diamond/README.md +69 -0
- data/tracks/r/exercises/diamond/diamond.R +3 -0
- data/tracks/r/exercises/diamond/example.R +15 -0
- data/tracks/r/exercises/diamond/test_diamond.R +90 -0
- data/tracks/scala/exercises/bob/.meta/description.md +10 -0
- data/tracks/sml/exercises/bob/.meta/description.md +10 -0
- data/tracks/swift/exercises/rotational-cipher/README.md +45 -0
- data/tracks/typescript/exercises/bob/.meta/description.md +10 -0
- data/tracks/vbnet/exercises/bob/.meta/description.md +10 -0
- data/tracks/vimscript/exercises/bob/.meta/description.md +10 -0
- metadata +70 -38
- data/tracks/elisp/docs/EXERCISE_README_INSERT.md +0 -0
- data/tracks/fortran/docs/EXERCISE_README_INSERT.md +0 -0
- data/tracks/gnu-apl/config/exercise-readme-insert.md +0 -0
- data/tracks/haxe/docs/EXERCISE_README_INSERT.md +0 -0
- data/tracks/nim/docs/EXERCISE_README_INSERT.md +0 -0
- data/tracks/powershell/docs/EXERCISE_README_INSERT.md +0 -0
- data/tracks/prolog/docs/EXERCISE_README_INSERT.md +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
// This file was auto-generated based on version 1.
|
1
|
+
// This file was auto-generated based on version 1.1.0 of the canonical data.
|
2
2
|
|
3
3
|
module ProverbTest
|
4
4
|
|
@@ -9,36 +9,36 @@ open Proverb
|
|
9
9
|
|
10
10
|
[<Fact>]
|
11
11
|
let ``Zero pieces`` () =
|
12
|
-
let
|
12
|
+
let strings: string list = []
|
13
13
|
let expected: string list = []
|
14
|
-
recite
|
14
|
+
recite strings |> should equal expected
|
15
15
|
|
16
16
|
[<Fact(Skip = "Remove to run test")>]
|
17
17
|
let ``One piece`` () =
|
18
|
-
let
|
18
|
+
let strings = ["nail"]
|
19
19
|
let expected = ["And all for the want of a nail."]
|
20
|
-
recite
|
20
|
+
recite strings |> should equal expected
|
21
21
|
|
22
22
|
[<Fact(Skip = "Remove to run test")>]
|
23
23
|
let ``Two pieces`` () =
|
24
|
-
let
|
24
|
+
let strings = ["nail"; "shoe"]
|
25
25
|
let expected =
|
26
26
|
[ "For want of a nail the shoe was lost.";
|
27
27
|
"And all for the want of a nail." ]
|
28
|
-
recite
|
28
|
+
recite strings |> should equal expected
|
29
29
|
|
30
30
|
[<Fact(Skip = "Remove to run test")>]
|
31
31
|
let ``Three pieces`` () =
|
32
|
-
let
|
32
|
+
let strings = ["nail"; "shoe"; "horse"]
|
33
33
|
let expected =
|
34
34
|
[ "For want of a nail the shoe was lost.";
|
35
35
|
"For want of a shoe the horse was lost.";
|
36
36
|
"And all for the want of a nail." ]
|
37
|
-
recite
|
37
|
+
recite strings |> should equal expected
|
38
38
|
|
39
39
|
[<Fact(Skip = "Remove to run test")>]
|
40
40
|
let ``Full proverb`` () =
|
41
|
-
let
|
41
|
+
let strings = ["nail"; "shoe"; "horse"; "rider"; "message"; "battle"; "kingdom"]
|
42
42
|
let expected =
|
43
43
|
[ "For want of a nail the shoe was lost.";
|
44
44
|
"For want of a shoe the horse was lost.";
|
@@ -47,15 +47,15 @@ let ``Full proverb`` () =
|
|
47
47
|
"For want of a message the battle was lost.";
|
48
48
|
"For want of a battle the kingdom was lost.";
|
49
49
|
"And all for the want of a nail." ]
|
50
|
-
recite
|
50
|
+
recite strings |> should equal expected
|
51
51
|
|
52
52
|
[<Fact(Skip = "Remove to run test")>]
|
53
53
|
let ``Four pieces modernized`` () =
|
54
|
-
let
|
54
|
+
let strings = ["pin"; "gun"; "soldier"; "battle"]
|
55
55
|
let expected =
|
56
56
|
[ "For want of a pin the gun was lost.";
|
57
57
|
"For want of a gun the soldier was lost.";
|
58
58
|
"For want of a soldier the battle was lost.";
|
59
59
|
"And all for the want of a pin." ]
|
60
|
-
recite
|
60
|
+
recite strings |> should equal expected
|
61
61
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// This file was auto-generated based on version 1.
|
1
|
+
// This file was auto-generated based on version 1.1.0 of the canonical data.
|
2
2
|
|
3
3
|
module RectanglesTest
|
4
4
|
|
@@ -9,109 +9,109 @@ open Rectangles
|
|
9
9
|
|
10
10
|
[<Fact>]
|
11
11
|
let ``No rows`` () =
|
12
|
-
let
|
13
|
-
rectangles
|
12
|
+
let strings = []
|
13
|
+
rectangles strings |> should equal 0
|
14
14
|
|
15
15
|
[<Fact(Skip = "Remove to run test")>]
|
16
16
|
let ``No columns`` () =
|
17
|
-
let
|
18
|
-
rectangles
|
17
|
+
let strings = [""]
|
18
|
+
rectangles strings |> should equal 0
|
19
19
|
|
20
20
|
[<Fact(Skip = "Remove to run test")>]
|
21
21
|
let ``No rectangles`` () =
|
22
|
-
let
|
23
|
-
rectangles
|
22
|
+
let strings = [" "]
|
23
|
+
rectangles strings |> should equal 0
|
24
24
|
|
25
25
|
[<Fact(Skip = "Remove to run test")>]
|
26
26
|
let ``One rectangle`` () =
|
27
|
-
let
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
rectangles
|
27
|
+
let strings =
|
28
|
+
[ "+-+";
|
29
|
+
"| |";
|
30
|
+
"+-+" ]
|
31
|
+
rectangles strings |> should equal 1
|
32
32
|
|
33
33
|
[<Fact(Skip = "Remove to run test")>]
|
34
34
|
let ``Two rectangles without shared parts`` () =
|
35
|
-
let
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
rectangles
|
35
|
+
let strings =
|
36
|
+
[ " +-+";
|
37
|
+
" | |";
|
38
|
+
"+-+-+";
|
39
|
+
"| | ";
|
40
|
+
"+-+ " ]
|
41
|
+
rectangles strings |> should equal 2
|
42
42
|
|
43
43
|
[<Fact(Skip = "Remove to run test")>]
|
44
44
|
let ``Five rectangles with shared parts`` () =
|
45
|
-
let
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
rectangles
|
45
|
+
let strings =
|
46
|
+
[ " +-+";
|
47
|
+
" | |";
|
48
|
+
"+-+-+";
|
49
|
+
"| | |";
|
50
|
+
"+-+-+" ]
|
51
|
+
rectangles strings |> should equal 5
|
52
52
|
|
53
53
|
[<Fact(Skip = "Remove to run test")>]
|
54
54
|
let ``Rectangle of height 1 is counted`` () =
|
55
|
-
let
|
56
|
-
|
57
|
-
|
58
|
-
rectangles
|
55
|
+
let strings =
|
56
|
+
[ "+--+";
|
57
|
+
"+--+" ]
|
58
|
+
rectangles strings |> should equal 1
|
59
59
|
|
60
60
|
[<Fact(Skip = "Remove to run test")>]
|
61
61
|
let ``Rectangle of width 1 is counted`` () =
|
62
|
-
let
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
rectangles
|
62
|
+
let strings =
|
63
|
+
[ "++";
|
64
|
+
"||";
|
65
|
+
"++" ]
|
66
|
+
rectangles strings |> should equal 1
|
67
67
|
|
68
68
|
[<Fact(Skip = "Remove to run test")>]
|
69
69
|
let ``1x1 square is counted`` () =
|
70
|
-
let
|
71
|
-
|
72
|
-
|
73
|
-
rectangles
|
70
|
+
let strings =
|
71
|
+
[ "++";
|
72
|
+
"++" ]
|
73
|
+
rectangles strings |> should equal 1
|
74
74
|
|
75
75
|
[<Fact(Skip = "Remove to run test")>]
|
76
76
|
let ``Only complete rectangles are counted`` () =
|
77
|
-
let
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
rectangles
|
77
|
+
let strings =
|
78
|
+
[ " +-+";
|
79
|
+
" |";
|
80
|
+
"+-+-+";
|
81
|
+
"| | -";
|
82
|
+
"+-+-+" ]
|
83
|
+
rectangles strings |> should equal 1
|
84
84
|
|
85
85
|
[<Fact(Skip = "Remove to run test")>]
|
86
86
|
let ``Rectangles can be of different sizes`` () =
|
87
|
-
let
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
rectangles
|
87
|
+
let strings =
|
88
|
+
[ "+------+----+";
|
89
|
+
"| | |";
|
90
|
+
"+---+--+ |";
|
91
|
+
"| | |";
|
92
|
+
"+---+-------+" ]
|
93
|
+
rectangles strings |> should equal 3
|
94
94
|
|
95
95
|
[<Fact(Skip = "Remove to run test")>]
|
96
96
|
let ``Corner is required for a rectangle to be complete`` () =
|
97
|
-
let
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
rectangles
|
97
|
+
let strings =
|
98
|
+
[ "+------+----+";
|
99
|
+
"| | |";
|
100
|
+
"+------+ |";
|
101
|
+
"| | |";
|
102
|
+
"+---+-------+" ]
|
103
|
+
rectangles strings |> should equal 2
|
104
104
|
|
105
105
|
[<Fact(Skip = "Remove to run test")>]
|
106
106
|
let ``Large input with many rectangles`` () =
|
107
|
-
let
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
rectangles
|
107
|
+
let strings =
|
108
|
+
[ "+---+--+----+";
|
109
|
+
"| +--+----+";
|
110
|
+
"+---+--+ |";
|
111
|
+
"| +--+----+";
|
112
|
+
"+---+--+--+-+";
|
113
|
+
"+---+--+--+-+";
|
114
|
+
"+------+ | |";
|
115
|
+
" +-+" ]
|
116
|
+
rectangles strings |> should equal 60
|
117
117
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// This file was auto-generated based on version 1.
|
1
|
+
// This file was auto-generated based on version 1.2.0 of the canonical data.
|
2
2
|
|
3
3
|
module RomanNumeralsTest
|
4
4
|
|
@@ -43,6 +43,10 @@ let ``20 is two X's`` () =
|
|
43
43
|
let ``48 is not 50 - 2 but rather 40 + 8`` () =
|
44
44
|
roman 48 |> should equal "XLVIII"
|
45
45
|
|
46
|
+
[<Fact(Skip = "Remove to run test")>]
|
47
|
+
let ``49 is not 40 + 5 + 4 but rather 50 - 10 + 10 - 1`` () =
|
48
|
+
roman 49 |> should equal "XLIX"
|
49
|
+
|
46
50
|
[<Fact(Skip = "Remove to run test")>]
|
47
51
|
let ``50 is a single L`` () =
|
48
52
|
roman 59 |> should equal "LIX"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// This file was auto-generated based on version 1.
|
1
|
+
// This file was auto-generated based on version 1.2.0 of the canonical data.
|
2
2
|
|
3
3
|
module WordCountTest
|
4
4
|
|
@@ -10,7 +10,7 @@ open WordCount
|
|
10
10
|
[<Fact>]
|
11
11
|
let ``Count one word`` () =
|
12
12
|
let expected = [("word", 1)] |> Map.ofList
|
13
|
-
|
13
|
+
countWords "word" |> should equal expected
|
14
14
|
|
15
15
|
[<Fact(Skip = "Remove to run test")>]
|
16
16
|
let ``Count one of each word`` () =
|
@@ -19,7 +19,7 @@ let ``Count one of each word`` () =
|
|
19
19
|
("of", 1);
|
20
20
|
("each", 1) ]
|
21
21
|
|> Map.ofList
|
22
|
-
|
22
|
+
countWords "one of each" |> should equal expected
|
23
23
|
|
24
24
|
[<Fact(Skip = "Remove to run test")>]
|
25
25
|
let ``Multiple occurrences of a word`` () =
|
@@ -30,7 +30,7 @@ let ``Multiple occurrences of a word`` () =
|
|
30
30
|
("red", 1);
|
31
31
|
("blue", 1) ]
|
32
32
|
|> Map.ofList
|
33
|
-
|
33
|
+
countWords "one fish two fish red fish blue fish" |> should equal expected
|
34
34
|
|
35
35
|
[<Fact(Skip = "Remove to run test")>]
|
36
36
|
let ``Handles cramped lists`` () =
|
@@ -39,7 +39,7 @@ let ``Handles cramped lists`` () =
|
|
39
39
|
("two", 1);
|
40
40
|
("three", 1) ]
|
41
41
|
|> Map.ofList
|
42
|
-
|
42
|
+
countWords "one,two,three" |> should equal expected
|
43
43
|
|
44
44
|
[<Fact(Skip = "Remove to run test")>]
|
45
45
|
let ``Handles expanded lists`` () =
|
@@ -48,7 +48,7 @@ let ``Handles expanded lists`` () =
|
|
48
48
|
("two", 1);
|
49
49
|
("three", 1) ]
|
50
50
|
|> Map.ofList
|
51
|
-
|
51
|
+
countWords "one,\ntwo,\nthree" |> should equal expected
|
52
52
|
|
53
53
|
[<Fact(Skip = "Remove to run test")>]
|
54
54
|
let ``Ignore punctuation`` () =
|
@@ -59,7 +59,7 @@ let ``Ignore punctuation`` () =
|
|
59
59
|
("java", 1);
|
60
60
|
("javascript", 1) ]
|
61
61
|
|> Map.ofList
|
62
|
-
|
62
|
+
countWords "car: carpet as java: javascript!!&@$%^&" |> should equal expected
|
63
63
|
|
64
64
|
[<Fact(Skip = "Remove to run test")>]
|
65
65
|
let ``Include numbers`` () =
|
@@ -68,7 +68,7 @@ let ``Include numbers`` () =
|
|
68
68
|
("1", 1);
|
69
69
|
("2", 1) ]
|
70
70
|
|> Map.ofList
|
71
|
-
|
71
|
+
countWords "testing, 1, 2 testing" |> should equal expected
|
72
72
|
|
73
73
|
[<Fact(Skip = "Remove to run test")>]
|
74
74
|
let ``Normalize case`` () =
|
@@ -76,7 +76,7 @@ let ``Normalize case`` () =
|
|
76
76
|
[ ("go", 3);
|
77
77
|
("stop", 2) ]
|
78
78
|
|> Map.ofList
|
79
|
-
|
79
|
+
countWords "go Go GO Stop stop" |> should equal expected
|
80
80
|
|
81
81
|
[<Fact(Skip = "Remove to run test")>]
|
82
82
|
let ``With apostrophes`` () =
|
@@ -87,7 +87,7 @@ let ``With apostrophes`` () =
|
|
87
87
|
("then", 1);
|
88
88
|
("cry", 1) ]
|
89
89
|
|> Map.ofList
|
90
|
-
|
90
|
+
countWords "First: don't laugh. Then: don't cry." |> should equal expected
|
91
91
|
|
92
92
|
[<Fact(Skip = "Remove to run test")>]
|
93
93
|
let ``With quotations`` () =
|
@@ -99,7 +99,7 @@ let ``With quotations`` () =
|
|
99
99
|
("large", 2);
|
100
100
|
("and", 1) ]
|
101
101
|
|> Map.ofList
|
102
|
-
|
102
|
+
countWords "Joe can't tell between 'large' and large." |> should equal expected
|
103
103
|
|
104
104
|
[<Fact(Skip = "Remove to run test")>]
|
105
105
|
let ``Multiple spaces not detected as a word`` () =
|
@@ -107,5 +107,5 @@ let ``Multiple spaces not detected as a word`` () =
|
|
107
107
|
[ ("multiple", 1);
|
108
108
|
("whitespaces", 1) ]
|
109
109
|
|> Map.ofList
|
110
|
-
|
110
|
+
countWords " multiple whitespaces" |> should equal expected
|
111
111
|
|
@@ -235,7 +235,7 @@ type Clock() =
|
|
235
235
|
sprintf "let %s = create %s %s" clockId hour minute
|
236
236
|
|
237
237
|
member private this.RenderPropertyValue canonicalDataCase property =
|
238
|
-
this.RenderSutParameter (canonicalDataCase, property, Map.find property canonicalDataCase.
|
238
|
+
this.RenderSutParameter (canonicalDataCase, property, Map.find property canonicalDataCase.Input)
|
239
239
|
|
240
240
|
override __.PropertiesWithIdentifier _ = ["clock1"; "clock2"]
|
241
241
|
|
@@ -246,7 +246,7 @@ type Clock() =
|
|
246
246
|
|
247
247
|
override this.RenderArrange canonicalDataCase =
|
248
248
|
match canonicalDataCase.Property with
|
249
|
-
| "create" | "add" ->
|
249
|
+
| "create" | "add" | "subtract" ->
|
250
250
|
let hour = this.RenderPropertyValue canonicalDataCase "hour"
|
251
251
|
let minute = this.RenderPropertyValue canonicalDataCase "minute"
|
252
252
|
[sprintf "let clock = create %s %s" hour minute]
|
@@ -258,8 +258,11 @@ type Clock() =
|
|
258
258
|
| "create" ->
|
259
259
|
sprintf "display clock"
|
260
260
|
| "add" ->
|
261
|
-
this.RenderPropertyValue canonicalDataCase "
|
261
|
+
this.RenderPropertyValue canonicalDataCase "value"
|
262
262
|
|> sprintf "add %s clock |> display"
|
263
|
+
| "subtract" ->
|
264
|
+
this.RenderPropertyValue canonicalDataCase "value"
|
265
|
+
|> sprintf "subtract %s clock |> display"
|
263
266
|
| "equal" ->
|
264
267
|
"clock1 = clock2"
|
265
268
|
| _ ->
|
@@ -732,7 +735,7 @@ type PalindromeProducts() =
|
|
732
735
|
|> formatOption
|
733
736
|
|> parenthesizeOption
|
734
737
|
|
735
|
-
override __.PropertiesUsedAsSutParameter _ = ["
|
738
|
+
override __.PropertiesUsedAsSutParameter _ = ["min"; "max"]
|
736
739
|
|
737
740
|
type PascalsTriangle() =
|
738
741
|
inherit GeneratorExercise()
|
@@ -790,7 +793,7 @@ type PigLatin() =
|
|
790
793
|
type Poker() =
|
791
794
|
inherit GeneratorExercise()
|
792
795
|
|
793
|
-
override
|
796
|
+
override this.PropertiesWithIdentifier canonicalDataCase = this.Properties canonicalDataCase
|
794
797
|
|
795
798
|
type Pov() =
|
796
799
|
inherit GeneratorExercise()
|
@@ -841,7 +844,6 @@ type Pov() =
|
|
841
844
|
}
|
842
845
|
|> Seq.toList
|
843
846
|
|
844
|
-
|
845
847
|
override __.RenderSut canonicalDataCase =
|
846
848
|
match canonicalDataCase.Property with
|
847
849
|
| "fromPov" ->
|
@@ -890,7 +892,7 @@ type ProteinTranslation() =
|
|
890
892
|
type Proverb() =
|
891
893
|
inherit GeneratorExercise()
|
892
894
|
|
893
|
-
override
|
895
|
+
override this.PropertiesWithIdentifier canonicalDataCase = this.Properties canonicalDataCase
|
894
896
|
|
895
897
|
override __.RenderExpected (_, _, value) =
|
896
898
|
value :?> JArray
|
@@ -1010,31 +1012,13 @@ type React() =
|
|
1010
1012
|
type Rectangles() =
|
1011
1013
|
inherit GeneratorExercise()
|
1012
1014
|
|
1013
|
-
|
1014
|
-
String.replicate n " "
|
1015
|
-
|
1016
|
-
member private this.FormatList (list: List<string>) =
|
1017
|
-
let separator = "; \n" + (this.GetPadding 8)
|
1018
|
-
let value =
|
1019
|
-
list
|
1020
|
-
|> String.concat separator
|
1021
|
-
|
1022
|
-
if list.Length < 2 then
|
1023
|
-
sprintf "[%s]" value
|
1024
|
-
else
|
1025
|
-
sprintf "\n%s[ %s ]" (this.GetPadding 6) value
|
1026
|
-
|
1027
|
-
override __.PropertiesWithIdentifier _ = ["input"]
|
1028
|
-
override __.RenderSutProperty _ = "rectangles"
|
1015
|
+
override this.PropertiesWithIdentifier canonicalDataCase = this.PropertiesUsedAsSutParameter canonicalDataCase
|
1029
1016
|
|
1030
|
-
override
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|> this.FormatList
|
1036
|
-
| _ ->
|
1037
|
-
base.RenderValueWithoutIdentifier (canonicalDataCase, key, value)
|
1017
|
+
override __.RenderInput (_, _, value) =
|
1018
|
+
value :?> JArray
|
1019
|
+
|> normalizeJArray
|
1020
|
+
|> Seq.map formatValue
|
1021
|
+
|> formatMultiLineList
|
1038
1022
|
|
1039
1023
|
type ReverseString() =
|
1040
1024
|
inherit GeneratorExercise()
|
@@ -1067,10 +1051,10 @@ type RobotSimulator() =
|
|
1067
1051
|
|
1068
1052
|
override __.PropertiesWithIdentifier canonicalDataCase =
|
1069
1053
|
match parseInput canonicalDataCase.Expected with
|
1070
|
-
| None, Some _ -> ["
|
1071
|
-
| Some _, None -> ["
|
1072
|
-
| Some _, Some _ -> ["
|
1073
|
-
| None, None -> ["
|
1054
|
+
| None, Some _ -> ["sut"]
|
1055
|
+
| Some _, None -> ["sut"]
|
1056
|
+
| Some _, Some _ -> ["expected"]
|
1057
|
+
| None, None -> ["sut"; "expected"]
|
1074
1058
|
|
1075
1059
|
override __.ToTestMethodBodyAssert canonicalDataCase =
|
1076
1060
|
let testMethodBodyAssert = base.ToTestMethodBodyAssert(canonicalDataCase)
|
@@ -1080,15 +1064,17 @@ type RobotSimulator() =
|
|
1080
1064
|
| Some _, None -> { testMethodBodyAssert with Sut = sprintf "%s.direction" testMethodBodyAssert.Sut }
|
1081
1065
|
| _ -> testMethodBodyAssert
|
1082
1066
|
|
1083
|
-
override __.
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1067
|
+
override __.RenderArrange canonicalDataCase =
|
1068
|
+
sprintf "let robot = %s" (canonicalDataCase.Properties.["input"] |> parseInput |> renderInput) :: base.RenderArrange canonicalDataCase
|
1069
|
+
|
1070
|
+
override __.RenderExpected (_, _, value) =
|
1071
|
+
value |> parseInput |> renderInput
|
1088
1072
|
|
1089
1073
|
override __.RenderSut canonicalDataCase =
|
1090
1074
|
match canonicalDataCase.Property with
|
1091
1075
|
| "create" -> "robot"
|
1076
|
+
| "turnLeft" | "turnRight" | "advance" -> sprintf "%s robot" canonicalDataCase.Property
|
1077
|
+
| "instructions" -> sprintf "instructions %s robot" (formatValue canonicalDataCase.Input.["instructions"])
|
1092
1078
|
| _ -> base.RenderSut canonicalDataCase
|
1093
1079
|
|
1094
1080
|
override __.RenderTestMethodName canonicalDataCase =
|