From 9499e3db07b6bec4a55d002fcf581a8e3f593b6e Mon Sep 17 00:00:00 2001 From: Richard Neilsen <8201743+rneilsen@users.noreply.github.com> Date: Tue, 8 Mar 2022 09:56:09 +1100 Subject: [PATCH] Add reimplement of "with apostrophes" test As per [issue 1977](https://github.com/exercism/problem-specifications/issues/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. --- exercises/word-count/canonical-data.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/exercises/word-count/canonical-data.json b/exercises/word-count/canonical-data.json index 93ae9a4737..48d89a45e3 100644 --- a/exercises/word-count/canonical-data.json +++ b/exercises/word-count/canonical-data.json @@ -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",