Skip to content

Commit

Permalink
Add reimplement of "with apostrophes" test (#1982)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rneilsen authored Mar 8, 2022
1 parent caded1a commit 5753fef
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",
"reimplements": "4185a902-bdb0-4074-864c-f416e42a0f19",
"description": "with apostrophes",
"comments": ["Added a word with multiple letters after apostrophe"],
"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 5753fef

Please sign in to comment.