Skip to content

Commit

Permalink
Add reimplement of "with apostrophes" test
Browse files Browse the repository at this point in the history
As per [issue 1977](exercism#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 reimplement 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.
  • Loading branch information
rneilsen authored Mar 7, 2022
1 parent 988be7b commit 9499e3d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions exercises/word-count/canonical-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,26 @@
"cry": 1
}
},
{
"uuid": "4ff6c7d7-fcfc-43ef-b8e7-34ff1837a2d3",
"description": "with apostrophes",
"comments": ["Added a word with multiple letters after apostrophe"],
"reimplements": "4185a902-bdb0-4074-864c-f416e42a0f19",
"property": "countWords",
"input": {
"sentence": "'First: don't laugh. Then: don't cry. You're getting it.'"
},
"expected": {
"first": 1,
"don't": 2,
"laugh": 1,
"then": 1,
"cry": 1,
"you're": 1,
"getting": 1,
"it": 1
}
},
{
"uuid": "be72af2b-8afe-4337-b151-b297202e4a7b",
"description": "with quotations",
Expand Down

0 comments on commit 9499e3d

Please sign in to comment.