Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reimplement of "with apostrophes" test #1982

Merged
merged 2 commits into from
Mar 8, 2022
Merged

Conversation

rneilsen
Copy link
Contributor

@rneilsen rneilsen commented Mar 7, 2022

As per issue 1977, if the user's code was unable to correctly handle words with multiple letters after an apostrophe, e.g. "they've" (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 detect 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 version of the test will fail appropriately, and expose it.

rneilsen added 2 commits March 8, 2022 09:56
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.
"laugh": 1,
"then": 1,
"cry": 1,
"you're": 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that the "don't" has a value of 2, while "you're" has a value of 1. Should it not be a 2 as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's only one instance of "you're" in the input text. Or do you mean we should use an input that includes "you're" multiple times?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, sorry did not associate it directly with the inputs as a word count occurrence. Thought perhaps it was a contraction being counted as the two words it involves.

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kotp kotp merged commit 5753fef into exercism:main Mar 8, 2022
@rneilsen rneilsen deleted the patch-1 branch March 9, 2022 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants