exercism / exercism/problem-specifications

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

Abierto
#1,977 3 comentarios 3 reacciones 0 asignados Ver en GitHub
new test case idea
Lenguaje dominante
Ruby
Estrellas
358
Forks
563
Merge medio
18 h 41 min
PR fusionados (30 d)
2

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.