exercism / exercism/problem-specifications

Word Count: Apostrophe bug that users' submissions could plausibly include, that current tests won't detect

Ouverte
#1,977 3 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
new test case idea
Langage dominant
Ruby
Étoiles
358
Forks
563
Merge moyen
18 h 41 min
PR mergées (30 j)
2

Description

The current test suite for the [word-count exercise](https://github.com/exercism/problem-specifications/tree/main/exercises/word-count) tests for words containing apostrophes, but the only examples used in the test cases themselves are words that only have one letter after the apostrophe (specifically, "can't" and "don't").

As a consequence, if a user implements code that doesn't correctly handle words with more than one letter after the apostrophe (like I did, with a regex that looked like `/([a-z]+'[a-z]| ... )/`) the tests will not identify the problem. There aren't a lot of English examples where this might cause miscounts - the only one I could think of was "m'lord"/"m'lady", other than fantasy stuff like "bat'leth"/"bat'leths" - but the thought process that got me there seems pretty plausible as a mistake others might make (I looked at the test cases, saw "don't" and "can't", and thought of "I'm" and "he's", and _didn't_ think of "you're" and "they'll"), so it seems like something worth checking for in the test cases.

Seems like a pretty easy fix to update the "with apostrophes" test case to include a word like "you're" or whatever, I'm happy to submit a PR if it's agreed as worthwhile.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.