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.
- 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
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2
|
@@ -2,8 +2,9 @@ require 'generator/exercise_case'
|
|
2
2
|
|
3
3
|
class BobCase < Generator::ExerciseCase
|
4
4
|
def workload
|
5
|
-
indent_lines(["remark = #{input.inspect}",
|
6
|
-
"assert_equal
|
5
|
+
indent_lines(["remark = #{input["heyBob"].inspect}",
|
6
|
+
"assert_equal #{expected.inspect}, Bob.hey(remark), %q{Bob hears #{input["heyBob"].inspect}, and..}"
|
7
7
|
], 4)
|
8
8
|
end
|
9
9
|
end
|
10
|
+
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module BookKeeping
|
2
|
-
VERSION =
|
2
|
+
VERSION = 2
|
3
3
|
end
|
4
4
|
|
5
5
|
module Bob
|
@@ -11,6 +11,8 @@ module Bob
|
|
11
11
|
case
|
12
12
|
when phrase.silent?
|
13
13
|
'Fine. Be that way!'
|
14
|
+
when phrase.loud? && phrase.quizzical?
|
15
|
+
'Calm down, I know what I\'m doing!'
|
14
16
|
when phrase.loud?
|
15
17
|
'Whoa, chill out!'
|
16
18
|
when phrase.quizzical?
|
@@ -6,6 +6,8 @@ Bob answers 'Sure.' if you ask him a question.
|
|
6
6
|
|
7
7
|
He answers 'Whoa, chill out!' if you yell at him.
|
8
8
|
|
9
|
+
He answers 'Calm down, I know what I'm doing!' if you yell a question at him.
|
10
|
+
|
9
11
|
He says 'Fine. Be that way!' if you address him without actually saying
|
10
12
|
anything.
|
11
13
|
|
@@ -1,156 +1,156 @@
|
|
1
1
|
require 'minitest/autorun'
|
2
2
|
require_relative 'bob'
|
3
3
|
|
4
|
-
# Common test data version: 1.
|
4
|
+
# Common test data version: 1.2.0 6dc2014
|
5
5
|
class BobTest < Minitest::Test
|
6
6
|
def test_stating_something
|
7
7
|
# skip
|
8
8
|
remark = "Tom-ay-to, tom-aaaah-to."
|
9
|
-
assert_equal
|
9
|
+
assert_equal "Whatever.", Bob.hey(remark), %q{Bob hears "Tom-ay-to, tom-aaaah-to.", and..}
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_shouting
|
13
13
|
skip
|
14
14
|
remark = "WATCH OUT!"
|
15
|
-
assert_equal
|
15
|
+
assert_equal "Whoa, chill out!", Bob.hey(remark), %q{Bob hears "WATCH OUT!", and..}
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_shouting_gibberish
|
19
19
|
skip
|
20
20
|
remark = "FCECDFCAAB"
|
21
|
-
assert_equal
|
21
|
+
assert_equal "Whoa, chill out!", Bob.hey(remark), %q{Bob hears "FCECDFCAAB", and..}
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_asking_a_question
|
25
25
|
skip
|
26
26
|
remark = "Does this cryogenic chamber make me look fat?"
|
27
|
-
assert_equal
|
27
|
+
assert_equal "Sure.", Bob.hey(remark), %q{Bob hears "Does this cryogenic chamber make me look fat?", and..}
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_asking_a_numeric_question
|
31
31
|
skip
|
32
32
|
remark = "You are, what, like 15?"
|
33
|
-
assert_equal
|
33
|
+
assert_equal "Sure.", Bob.hey(remark), %q{Bob hears "You are, what, like 15?", and..}
|
34
34
|
end
|
35
35
|
|
36
36
|
def test_asking_gibberish
|
37
37
|
skip
|
38
38
|
remark = "fffbbcbeab?"
|
39
|
-
assert_equal
|
39
|
+
assert_equal "Sure.", Bob.hey(remark), %q{Bob hears "fffbbcbeab?", and..}
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_talking_forcefully
|
43
43
|
skip
|
44
44
|
remark = "Let's go make out behind the gym!"
|
45
|
-
assert_equal
|
45
|
+
assert_equal "Whatever.", Bob.hey(remark), %q{Bob hears "Let's go make out behind the gym!", and..}
|
46
46
|
end
|
47
47
|
|
48
48
|
def test_using_acronyms_in_regular_speech
|
49
49
|
skip
|
50
50
|
remark = "It's OK if you don't want to go to the DMV."
|
51
|
-
assert_equal
|
51
|
+
assert_equal "Whatever.", Bob.hey(remark), %q{Bob hears "It's OK if you don't want to go to the DMV.", and..}
|
52
52
|
end
|
53
53
|
|
54
54
|
def test_forceful_question
|
55
55
|
skip
|
56
56
|
remark = "WHAT THE HELL WERE YOU THINKING?"
|
57
|
-
assert_equal
|
57
|
+
assert_equal "Calm down, I know what I'm doing!", Bob.hey(remark), %q{Bob hears "WHAT THE HELL WERE YOU THINKING?", and..}
|
58
58
|
end
|
59
59
|
|
60
60
|
def test_shouting_numbers
|
61
61
|
skip
|
62
62
|
remark = "1, 2, 3 GO!"
|
63
|
-
assert_equal
|
63
|
+
assert_equal "Whoa, chill out!", Bob.hey(remark), %q{Bob hears "1, 2, 3 GO!", and..}
|
64
64
|
end
|
65
65
|
|
66
66
|
def test_only_numbers
|
67
67
|
skip
|
68
68
|
remark = "1, 2, 3"
|
69
|
-
assert_equal
|
69
|
+
assert_equal "Whatever.", Bob.hey(remark), %q{Bob hears "1, 2, 3", and..}
|
70
70
|
end
|
71
71
|
|
72
72
|
def test_question_with_only_numbers
|
73
73
|
skip
|
74
74
|
remark = "4?"
|
75
|
-
assert_equal
|
75
|
+
assert_equal "Sure.", Bob.hey(remark), %q{Bob hears "4?", and..}
|
76
76
|
end
|
77
77
|
|
78
78
|
def test_shouting_with_special_characters
|
79
79
|
skip
|
80
80
|
remark = "ZOMG THE %^*@\#$(*^ ZOMBIES ARE COMING!!11!!1!"
|
81
|
-
assert_equal
|
81
|
+
assert_equal "Whoa, chill out!", Bob.hey(remark), %q{Bob hears "ZOMG THE %^*@\#$(*^ ZOMBIES ARE COMING!!11!!1!", and..}
|
82
82
|
end
|
83
83
|
|
84
84
|
def test_shouting_with_no_exclamation_mark
|
85
85
|
skip
|
86
86
|
remark = "I HATE YOU"
|
87
|
-
assert_equal
|
87
|
+
assert_equal "Whoa, chill out!", Bob.hey(remark), %q{Bob hears "I HATE YOU", and..}
|
88
88
|
end
|
89
89
|
|
90
90
|
def test_statement_containing_question_mark
|
91
91
|
skip
|
92
92
|
remark = "Ending with ? means a question."
|
93
|
-
assert_equal
|
93
|
+
assert_equal "Whatever.", Bob.hey(remark), %q{Bob hears "Ending with ? means a question.", and..}
|
94
94
|
end
|
95
95
|
|
96
96
|
def test_non_letters_with_question
|
97
97
|
skip
|
98
98
|
remark = ":) ?"
|
99
|
-
assert_equal
|
99
|
+
assert_equal "Sure.", Bob.hey(remark), %q{Bob hears ":) ?", and..}
|
100
100
|
end
|
101
101
|
|
102
102
|
def test_prattling_on
|
103
103
|
skip
|
104
104
|
remark = "Wait! Hang on. Are you going to be OK?"
|
105
|
-
assert_equal
|
105
|
+
assert_equal "Sure.", Bob.hey(remark), %q{Bob hears "Wait! Hang on. Are you going to be OK?", and..}
|
106
106
|
end
|
107
107
|
|
108
108
|
def test_silence
|
109
109
|
skip
|
110
110
|
remark = ""
|
111
|
-
assert_equal
|
111
|
+
assert_equal "Fine. Be that way!", Bob.hey(remark), %q{Bob hears "", and..}
|
112
112
|
end
|
113
113
|
|
114
114
|
def test_prolonged_silence
|
115
115
|
skip
|
116
116
|
remark = " "
|
117
|
-
assert_equal
|
117
|
+
assert_equal "Fine. Be that way!", Bob.hey(remark), %q{Bob hears " ", and..}
|
118
118
|
end
|
119
119
|
|
120
120
|
def test_alternate_silence
|
121
121
|
skip
|
122
122
|
remark = "\t\t\t\t\t\t\t\t\t\t"
|
123
|
-
assert_equal
|
123
|
+
assert_equal "Fine. Be that way!", Bob.hey(remark), %q{Bob hears "\t\t\t\t\t\t\t\t\t\t", and..}
|
124
124
|
end
|
125
125
|
|
126
126
|
def test_multiple_line_question
|
127
127
|
skip
|
128
128
|
remark = "\nDoes this cryogenic chamber make me look fat?\nno"
|
129
|
-
assert_equal
|
129
|
+
assert_equal "Whatever.", Bob.hey(remark), %q{Bob hears "\nDoes this cryogenic chamber make me look fat?\nno", and..}
|
130
130
|
end
|
131
131
|
|
132
132
|
def test_starting_with_whitespace
|
133
133
|
skip
|
134
134
|
remark = " hmmmmmmm..."
|
135
|
-
assert_equal
|
135
|
+
assert_equal "Whatever.", Bob.hey(remark), %q{Bob hears " hmmmmmmm...", and..}
|
136
136
|
end
|
137
137
|
|
138
138
|
def test_ending_with_whitespace
|
139
139
|
skip
|
140
140
|
remark = "Okay if like my spacebar quite a bit? "
|
141
|
-
assert_equal
|
141
|
+
assert_equal "Sure.", Bob.hey(remark), %q{Bob hears "Okay if like my spacebar quite a bit? ", and..}
|
142
142
|
end
|
143
143
|
|
144
144
|
def test_other_whitespace
|
145
145
|
skip
|
146
146
|
remark = "\n\r \t"
|
147
|
-
assert_equal
|
147
|
+
assert_equal "Fine. Be that way!", Bob.hey(remark), %q{Bob hears "\n\r \t", and..}
|
148
148
|
end
|
149
149
|
|
150
150
|
def test_non_question_ending_with_whitespace
|
151
151
|
skip
|
152
152
|
remark = "This is a statement ending with whitespace "
|
153
|
-
assert_equal
|
153
|
+
assert_equal "Whatever.", Bob.hey(remark), %q{Bob hears "This is a statement ending with whitespace ", and..}
|
154
154
|
end
|
155
155
|
|
156
156
|
# Problems in exercism evolve over time, as we find better ways to ask
|
@@ -172,6 +172,6 @@ class BobTest < Minitest::Test
|
|
172
172
|
|
173
173
|
def test_bookkeeping
|
174
174
|
skip
|
175
|
-
assert_equal
|
175
|
+
assert_equal 2, BookKeeping::VERSION
|
176
176
|
end
|
177
177
|
end
|
@@ -36,7 +36,7 @@ The goal is to have all passing tests, which will show in two places:
|
|
36
36
|
|
37
37
|
1. `SSSSSSESSSSSSSSS` will become a series dots: `................`,
|
38
38
|
|
39
|
-
2. The line at the bottom will read `16 runs,
|
39
|
+
2. The line at the bottom will read `16 runs, 16 assertions, 0 failures, 0
|
40
40
|
errors, 0 skips`.
|
41
41
|
|
42
42
|
## Passing Tests
|
data/tracks/rust/.travis.yml
CHANGED
@@ -6,6 +6,7 @@ script:
|
|
6
6
|
- "sh ./_test/ensure-stubs-compile.sh"
|
7
7
|
- "sh ./_test/count-ignores.sh"
|
8
8
|
- "./bin/fetch-configlet"
|
9
|
+
- "./_test/check-configlet-fmt.sh"
|
9
10
|
- "sh ./_test/ensure-readmes-are-updated.sh"
|
10
11
|
- "./bin/configlet lint ."
|
11
12
|
- "./_test/verify-exercise-difficulties.sh"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# This ensures that config.json and config/maintainers.json are compatible
|
4
|
+
# with the output of configlet fmt.
|
5
|
+
|
6
|
+
repo=$(cd "$(dirname "$0")/.." && pwd)
|
7
|
+
configlet="${repo}/bin/configlet"
|
8
|
+
|
9
|
+
c="${repo}/config.json"
|
10
|
+
m="${repo}/config/maintainers.json"
|
11
|
+
|
12
|
+
function md5 {
|
13
|
+
md5sum $1 | cut -d' ' -f1
|
14
|
+
}
|
15
|
+
|
16
|
+
# before S sum
|
17
|
+
bcs=$(md5 $c)
|
18
|
+
bms=$(md5 $m)
|
19
|
+
|
20
|
+
cfg=$($configlet fmt .)
|
21
|
+
if [ $? != 0 ]; then
|
22
|
+
echo "configlet fmt returned non-0 exit code with output:"
|
23
|
+
echo $cfg
|
24
|
+
exit 1
|
25
|
+
fi
|
26
|
+
|
27
|
+
# after S sum
|
28
|
+
acs=$(md5 $c)
|
29
|
+
ams=$(md5 $m)
|
30
|
+
|
31
|
+
if [ $bcs != $acs -o $bms != $ams ]; then
|
32
|
+
echo "configlet fmt:"
|
33
|
+
echo $cfg
|
34
|
+
echo "Please update the PR to incorporate those changes."
|
35
|
+
exit 1
|
36
|
+
fi
|
37
|
+
exit 0
|
@@ -1,59 +1,59 @@
|
|
1
1
|
{
|
2
2
|
"maintainers": [
|
3
3
|
{
|
4
|
-
"github_username": "IanWhitney",
|
5
|
-
"show_on_website": false,
|
6
4
|
"alumnus": false,
|
7
|
-
"
|
5
|
+
"avatar_url": null,
|
8
6
|
"bio": null,
|
7
|
+
"github_username": "IanWhitney",
|
9
8
|
"link_text": null,
|
10
9
|
"link_url": null,
|
11
|
-
"
|
10
|
+
"name": null,
|
11
|
+
"show_on_website": false
|
12
12
|
},
|
13
13
|
{
|
14
|
+
"alumnus": true,
|
14
15
|
"github_username": "etrepum",
|
15
|
-
"show_on_website": false
|
16
|
-
"alumnus": true
|
16
|
+
"show_on_website": false
|
17
17
|
},
|
18
18
|
{
|
19
|
-
"github_username": "ijanos",
|
20
|
-
"show_on_website": false,
|
21
19
|
"alumnus": false,
|
22
|
-
"
|
20
|
+
"avatar_url": null,
|
23
21
|
"bio": null,
|
22
|
+
"github_username": "ijanos",
|
24
23
|
"link_text": null,
|
25
24
|
"link_url": null,
|
26
|
-
"
|
25
|
+
"name": null,
|
26
|
+
"show_on_website": false
|
27
27
|
},
|
28
28
|
{
|
29
|
-
"github_username": "petertseng",
|
30
|
-
"show_on_website": false,
|
31
29
|
"alumnus": false,
|
32
|
-
"
|
30
|
+
"avatar_url": null,
|
33
31
|
"bio": null,
|
32
|
+
"github_username": "petertseng",
|
34
33
|
"link_text": null,
|
35
34
|
"link_url": null,
|
36
|
-
"
|
35
|
+
"name": null,
|
36
|
+
"show_on_website": false
|
37
37
|
},
|
38
38
|
{
|
39
|
-
"github_username": "EduardoBautista",
|
40
|
-
"show_on_website": false,
|
41
39
|
"alumnus": false,
|
42
|
-
"
|
40
|
+
"avatar_url": null,
|
43
41
|
"bio": null,
|
42
|
+
"github_username": "EduardoBautista",
|
44
43
|
"link_text": null,
|
45
44
|
"link_url": null,
|
46
|
-
"
|
45
|
+
"name": null,
|
46
|
+
"show_on_website": false
|
47
47
|
},
|
48
48
|
{
|
49
|
-
"github_username": "coriolinus",
|
50
|
-
"show_on_website": false,
|
51
49
|
"alumnus": false,
|
52
|
-
"
|
50
|
+
"avatar_url": null,
|
53
51
|
"bio": null,
|
52
|
+
"github_username": "coriolinus",
|
54
53
|
"link_text": null,
|
55
54
|
"link_url": null,
|
56
|
-
"
|
55
|
+
"name": null,
|
56
|
+
"show_on_website": false
|
57
57
|
}
|
58
58
|
]
|
59
|
-
}
|
59
|
+
}
|