From 5753fef99caa488702a7004de28b0c7d8f9d2eb6 Mon Sep 17 00:00:00 2001 From: Richard Neilsen <8201743+rneilsen@users.noreply.github.com> Date: Wed, 9 Mar 2022 04:29:59 +1100 Subject: [PATCH] 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]: https://github.com/exercism/problem-specifications/issues/1977 --- 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..fb3c372947 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", + "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",