Skip to content

Commit e6432a9

Browse files
authored
[bob] Sync exercise: add a new test and reorder existing tests (#785)
[no important files changed]
1 parent 17c58b9 commit e6432a9

2 files changed

Lines changed: 112 additions & 102 deletions

File tree

exercises/practice/bob/.meta/tests.toml

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,82 +9,85 @@
99
# As user-added comments (using the # character) will be removed when this file
1010
# is regenerated, comments can be added via a `comment` key.
1111

12-
[e162fead-606f-437a-a166-d051915cea8e]
13-
description = "stating something"
12+
[8a2e771d-d6f1-4e3f-b6c6-b41495556e37]
13+
description = "asking a question"
1414

1515
[73a966dc-8017-47d6-bb32-cf07d1a5fcd9]
1616
description = "shouting"
1717

18-
[d6c98afd-df35-4806-b55e-2c457c3ab748]
19-
description = "shouting gibberish"
18+
[a5193c61-4a92-4f68-93e2-f554eb385ec6]
19+
description = "forceful question"
2020

21-
[8a2e771d-d6f1-4e3f-b6c6-b41495556e37]
22-
description = "asking a question"
21+
[bc39f7c6-f543-41be-9a43-fd1c2f753fc0]
22+
description = "silence"
23+
24+
[e162fead-606f-437a-a166-d051915cea8e]
25+
description = "stating something"
2326

2427
[81080c62-4e4d-4066-b30a-48d8d76920d9]
2528
description = "asking a numeric question"
2629

2730
[2a02716d-685b-4e2e-a804-2adaf281c01e]
2831
description = "asking gibberish"
2932

30-
[c02f9179-ab16-4aa7-a8dc-940145c385f7]
31-
description = "talking forcefully"
33+
[bb0011c5-cd52-4a5b-8bfb-a87b6283b0e2]
34+
description = "question with no letters"
3235

33-
[153c0e25-9bb5-4ec5-966e-598463658bcd]
34-
description = "using acronyms in regular speech"
36+
[9bfc677d-ea3a-45f2-be44-35bc8fa3753e]
37+
description = "non-letters with question"
3538

36-
[a5193c61-4a92-4f68-93e2-f554eb385ec6]
37-
description = "forceful question"
39+
[8608c508-f7de-4b17-985b-811878b3cf45]
40+
description = "prattling on"
3841

39-
[a20e0c54-2224-4dde-8b10-bd2cdd4f61bc]
40-
description = "shouting numbers"
42+
[05b304d6-f83b-46e7-81e0-4cd3ca647900]
43+
description = "ending with whitespace"
4144

42-
[f7bc4b92-bdff-421e-a238-ae97f230ccac]
43-
description = "no letters"
45+
[2c7278ac-f955-4eb4-bf8f-e33eb4116a15]
46+
description = "multiple line question"
47+
reimplements = "66953780-165b-4e7e-8ce3-4bcb80b6385a"
4448

45-
[bb0011c5-cd52-4a5b-8bfb-a87b6283b0e2]
46-
description = "question with no letters"
49+
[d6c98afd-df35-4806-b55e-2c457c3ab748]
50+
description = "shouting gibberish"
51+
52+
[3c954328-86fb-4c71-8961-e18d6a5e2517]
53+
description = "shouting a statement containing a question mark"
54+
55+
[a20e0c54-2224-4dde-8b10-bd2cdd4f61bc]
56+
description = "shouting numbers"
4757

4858
[496143c8-1c31-4c01-8a08-88427af85c66]
4959
description = "shouting with special characters"
5060

5161
[e6793c1c-43bd-4b8d-bc11-499aea73925f]
5262
description = "shouting with no exclamation mark"
5363

54-
[aa8097cc-c548-4951-8856-14a404dd236a]
55-
description = "statement containing question mark"
56-
57-
[9bfc677d-ea3a-45f2-be44-35bc8fa3753e]
58-
description = "non-letters with question"
59-
60-
[8608c508-f7de-4b17-985b-811878b3cf45]
61-
description = "prattling on"
62-
63-
[bc39f7c6-f543-41be-9a43-fd1c2f753fc0]
64-
description = "silence"
65-
6664
[d6c47565-372b-4b09-b1dd-c40552b8378b]
6765
description = "prolonged silence"
6866

6967
[4428f28d-4100-4d85-a902-e5a78cb0ecd3]
7068
description = "alternate silence"
7169

70+
[72bd5ad3-9b2f-4931-a988-dce1f5771de2]
71+
description = "other whitespace"
72+
73+
[c02f9179-ab16-4aa7-a8dc-940145c385f7]
74+
description = "talking forcefully"
75+
76+
[153c0e25-9bb5-4ec5-966e-598463658bcd]
77+
description = "using acronyms in regular speech"
78+
79+
[f7bc4b92-bdff-421e-a238-ae97f230ccac]
80+
description = "no letters"
81+
82+
[aa8097cc-c548-4951-8856-14a404dd236a]
83+
description = "statement containing question mark"
84+
7285
[66953780-165b-4e7e-8ce3-4bcb80b6385a]
7386
description = "multiple line question"
7487
include = false
7588

7689
[5371ef75-d9ea-4103-bcfa-2da973ddec1b]
7790
description = "starting with whitespace"
7891

79-
[05b304d6-f83b-46e7-81e0-4cd3ca647900]
80-
description = "ending with whitespace"
81-
82-
[72bd5ad3-9b2f-4931-a988-dce1f5771de2]
83-
description = "other whitespace"
84-
8592
[12983553-8601-46a8-92fa-fcaa3bc4a2a0]
8693
description = "non-question ending with whitespace"
87-
88-
[2c7278ac-f955-4eb4-bf8f-e33eb4116a15]
89-
description = "multiple line question"
90-
reimplements = "66953780-165b-4e7e-8ce3-4bcb80b6385a"

exercises/practice/bob/bob.bats

Lines changed: 69 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ load bats-extra
33

44
# local version: 1.6.0.0
55

6-
@test "stating something" {
6+
@test "asking a question" {
77
#[[ $BATS_RUN_SKIPPED == "true" ]] || skip
8-
run bash bob.sh 'Tom-ay-to, tom-aaaah-to.'
8+
run bash bob.sh 'Does this cryogenic chamber make me look fat?'
99
assert_success
10-
assert_output "Whatever."
10+
assert_output "Sure."
1111
}
1212

1313
@test "shouting" {
@@ -17,18 +17,25 @@ load bats-extra
1717
assert_output "Whoa, chill out!"
1818
}
1919

20-
@test "shouting gibberish" {
20+
@test "forceful question" {
2121
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
22-
run bash bob.sh 'FCECDFCAAB'
22+
run bash bob.sh "WHAT'S GOING ON?"
2323
assert_success
24-
assert_output "Whoa, chill out!"
24+
assert_output "Calm down, I know what I'm doing!"
2525
}
2626

27-
@test "asking a question" {
27+
@test "silence" {
2828
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
29-
run bash bob.sh 'Does this cryogenic chamber make me look fat?'
29+
run bash bob.sh ''
3030
assert_success
31-
assert_output "Sure."
31+
assert_output "Fine. Be that way!"
32+
}
33+
34+
@test "stating something" {
35+
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
36+
run bash bob.sh 'Tom-ay-to, tom-aaaah-to.'
37+
assert_success
38+
assert_output "Whatever."
3239
}
3340

3441
@test "asking a numeric question" {
@@ -45,130 +52,130 @@ load bats-extra
4552
assert_output "Sure."
4653
}
4754

48-
@test "talking forcefully" {
55+
@test "question with no letters" {
4956
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
50-
run bash bob.sh "Hi there!"
57+
run bash bob.sh '4?'
5158
assert_success
52-
assert_output "Whatever."
59+
assert_output "Sure."
5360
}
5461

55-
@test "using acronyms in regular speech" {
62+
@test "non-letters with question" {
5663
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
57-
run bash bob.sh "It's OK if you don't want to go work for NASA."
64+
run bash bob.sh ':) ?'
5865
assert_success
59-
assert_output "Whatever."
66+
assert_output "Sure."
6067
}
6168

62-
@test "forceful question" {
69+
@test "prattling on" {
6370
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
64-
run bash bob.sh "WHAT'S GOING ON?"
71+
run bash bob.sh 'Wait! Hang on. Are you going to be OK?'
6572
assert_success
66-
assert_output "Calm down, I know what I'm doing!"
73+
assert_output "Sure."
6774
}
6875

69-
@test "shouting numbers" {
76+
@test "ending with whitespace" {
7077
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
71-
run bash bob.sh '1, 2, 3 GO!'
78+
run bash bob.sh 'Okay if like my spacebar quite a bit? '
7279
assert_success
73-
assert_output "Whoa, chill out!"
80+
assert_output "Sure."
7481
}
75-
76-
@test "no letters" {
82+
# This test might act differently depending on your platform
83+
@test "multiple line question" {
7784
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
78-
run bash bob.sh '1, 2, 3'
85+
run bash bob.sh $'\nDoes this cryogenic chamber make\n me look fat?'
7986
assert_success
80-
assert_output "Whatever."
87+
assert_output "Sure."
8188
}
8289

83-
@test "question with no letters" {
90+
@test "shouting gibberish" {
8491
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
85-
run bash bob.sh '4?'
92+
run bash bob.sh 'FCECDFCAAB'
8693
assert_success
87-
assert_output "Sure."
94+
assert_output "Whoa, chill out!"
8895
}
8996

90-
@test "shouting with special characters" {
91-
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
92-
run bash bob.sh 'ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!'
97+
@test "shouting a statement containing a question mark" {
98+
$BATS_RUN_SKIPPED == "true" ]] || skip
99+
run bash bob.sh 'DO LIONS EAT PEOPLE? AHHHHH.'
93100
assert_success
94101
assert_output "Whoa, chill out!"
95102
}
96103

97-
@test "shouting with no exclamation mark" {
104+
@test "shouting numbers" {
98105
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
99-
run bash bob.sh 'I HATE THE DENTIST'
106+
run bash bob.sh '1, 2, 3 GO!'
100107
assert_success
101108
assert_output "Whoa, chill out!"
102109
}
103110

104-
@test "statement containing question mark" {
111+
@test "shouting with special characters" {
105112
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
106-
run bash bob.sh 'Ending with ? means a question.'
113+
run bash bob.sh 'ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!'
107114
assert_success
108-
assert_output "Whatever."
115+
assert_output "Whoa, chill out!"
109116
}
110117

111-
@test "non-letters with question" {
118+
@test "shouting with no exclamation mark" {
112119
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
113-
run bash bob.sh ':) ?'
120+
run bash bob.sh 'I HATE THE DENTIST'
114121
assert_success
115-
assert_output "Sure."
122+
assert_output "Whoa, chill out!"
116123
}
117124

118-
@test "prattling on" {
125+
@test "prolonged silence" {
119126
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
120-
run bash bob.sh 'Wait! Hang on. Are you going to be OK?'
127+
run bash bob.sh ' '
121128
assert_success
122-
assert_output "Sure."
129+
assert_output "Fine. Be that way!"
123130
}
124131

125-
@test "silence" {
132+
@test "alternate silence" {
126133
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
127-
run bash bob.sh ''
134+
run bash bob.sh $'\t\t\t\t\t\t\t\t\t\t'
128135
assert_success
129136
assert_output "Fine. Be that way!"
130137
}
131138

132-
@test "prolonged silence" {
139+
@test "other whitespace" {
133140
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
134-
run bash bob.sh ' '
141+
run bash bob.sh $'\n\r \t'
135142
assert_success
136143
assert_output "Fine. Be that way!"
137144
}
138145

139-
@test "alternate silence" {
146+
@test "talking forcefully" {
140147
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
141-
run bash bob.sh $'\t\t\t\t\t\t\t\t\t\t'
148+
run bash bob.sh "Hi there!"
142149
assert_success
143-
assert_output "Fine. Be that way!"
150+
assert_output "Whatever."
144151
}
145152

146-
@test "multiple line question" {
153+
@test "using acronyms in regular speech" {
147154
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
148-
run bash bob.sh $'\nDoes this cryogenic chamber make\n me look fat?'
155+
run bash bob.sh "It's OK if you don't want to go work for NASA."
149156
assert_success
150-
assert_output "Sure."
157+
assert_output "Whatever."
151158
}
152159

153-
@test "starting with whitespace" {
160+
@test "no letters" {
154161
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
155-
run bash bob.sh ' hmmmmmmm...'
162+
run bash bob.sh '1, 2, 3'
156163
assert_success
157164
assert_output "Whatever."
158165
}
159166

160-
@test "ending with whitespace" {
167+
@test "statement containing question mark" {
161168
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
162-
run bash bob.sh 'Okay if like my spacebar quite a bit? '
169+
run bash bob.sh 'Ending with ? means a question.'
163170
assert_success
164-
assert_output "Sure."
171+
assert_output "Whatever."
165172
}
166-
# This test might act differently depending on your platform
167-
@test "other whitespace" {
173+
174+
@test "starting with whitespace" {
168175
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
169-
run bash bob.sh $'\n\r \t'
176+
run bash bob.sh ' hmmmmmmm...'
170177
assert_success
171-
assert_output "Fine. Be that way!"
178+
assert_output "Whatever."
172179
}
173180

174181
@test "non-question ending with whitespace" {
@@ -178,14 +185,14 @@ load bats-extra
178185
assert_output "Whatever."
179186
}
180187

188+
# bash-specific tests
181189
@test "no input is silence" {
182190
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
183191
run bash bob.sh
184192
assert_success
185193
assert_output "Fine. Be that way!"
186194
}
187195

188-
# bash-specific tests
189196
@test "yelling a filename expansion" {
190197
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
191198
run bash bob.sh '*READ* !'

0 commit comments

Comments
 (0)