line-up: add test cases for ordinal numbers that are multiples of 11/12/13 and update the descriptions - #2672
Open
QuentinNev wants to merge 2 commits into
Open
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
|
As requested in the forum, one or more of the numbers should be greater than 255. For example, 891, 923 or 972 |
Member
|
...and please make the descriptions more descriptive of the purpose of the tests (i.e. they should convey what the test adds/what gap they cover) |
QuentinNev
force-pushed
the
fix/add-line-up-ordinal-edge-cases
branch
from
July 28, 2026 17:56
550d34a to
2ed5484
Compare
Member
|
@QuentinNev Any updates here? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See discussion: http://forum.exercism.org/t/line-up-exercise-missing-test-case-for-ordinal-suffix-multiples-of-11-12-13-outside-the-teens-range-are-not-covered/67586
Summary
Adds test cases for
line-upcovering ordinal numbers that are multiples of 11, 12, or 13 outside the 11–13 range itself.It also reformulate the descriptions to be more explicit about what it's testing.
Problem
Uncovered multiples of 11, 12 and 13
The test suite for
line-updoes not include any numbers whose last two digits are a multiple of 11, 12, or 13 outside the 11–13 range itself (e.g. 22, 24, 33, 36, 44, 52, 60, 63, 65, 72, 78, 91, 96…).This gap allows an incorrect implementation to pass. For example, a common bug is checking divisibility instead of range when handling the "teens" exception:
This looks like it's meant to handle the 11th/12th/13th exception (and does, since 11%11=0, 12%12=0, 13%13=0), but it also incorrectly catches any other multiple of 11, 12, or 13 (such as 22, 33, 44, 52, 91) and returns "th" for them instead of the correct "nd"/"rd"/"st".
Unclear descriptions
As proposed in the discussion, the descriptions weren't clear enough about what they're covering
Changes