Skip to content

Commit 5753fef

Browse files
authored
Add reimplement of "with apostrophes" test (#1982)
* Re-implement "with apostrophes" test As per [#1977], if the user's code was unable to correctly handle words with multiple letters after an apostrophe (a plausible error one might make with a regex, for example), the previous version of the "with apostrophes" test, which only included the word "don't", would not detect the bug (and none of the other tests would find it either). This change is a re-implementation of the "with apostrophes" test to now include the word "you're" as part of the input, so if the user's code has a bug and incorrectly handles such words, the new test will fail and expose it. [#1977]: #1977
1 parent caded1a commit 5753fef

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

exercises/word-count/canonical-data.json

+20
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,26 @@
125125
"cry": 1
126126
}
127127
},
128+
{
129+
"uuid": "4ff6c7d7-fcfc-43ef-b8e7-34ff1837a2d3",
130+
"reimplements": "4185a902-bdb0-4074-864c-f416e42a0f19",
131+
"description": "with apostrophes",
132+
"comments": ["Added a word with multiple letters after apostrophe"],
133+
"property": "countWords",
134+
"input": {
135+
"sentence": "'First: don't laugh. Then: don't cry. You're getting it.'"
136+
},
137+
"expected": {
138+
"first": 1,
139+
"don't": 2,
140+
"laugh": 1,
141+
"then": 1,
142+
"cry": 1,
143+
"you're": 1,
144+
"getting": 1,
145+
"it": 1
146+
}
147+
},
128148
{
129149
"uuid": "be72af2b-8afe-4337-b151-b297202e4a7b",
130150
"description": "with quotations",

0 commit comments

Comments
 (0)