Skip to content

Line Up Exercise - Missing test case for ordinal suffix,multiples of 11/12/13 outside the teens range are not covered #1647

Closed

Description

@QuentinNev

Description

The test suite for line-up does 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:

if (last2 % 11 === 0 || last2 % 12 === 0 || last2 % 13 === 0) return `${number}th`;

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".

Expected behavior

  • 22 → "22nd" (a buggy implementation using the check above would produce "22th")
  • 33 → "33rd"
  • 52 → "52nd"
  • 91 → "91st"

Suggested fix

Add at least one test case per suffix category (1st/2nd/3rd/4th-equivalents) that is also a multiple of 11, 12, or 13, to catch this class of bug (e.g. 22, 33, 52, 91.)

If line-up has canonical data in problem-specifications, it may be worth raising there too, since it's shared across tracks.

Activity

  1. github-actions commented on Jul 25, 2026

    @github-actions
    Contributor

    Hello. Thanks for opening an issue on Exercism 🙂

    At Exercism we use our Community Forum, not GitHub issues, as the primary place for discussion. That allows maintainers and contributors from across Exercism's ecosystem to discuss your problems/ideas/suggestions without them having to subscribe to hundreds of repositories.

    This issue will be automatically closed. Please use this link to copy your GitHub Issue into a new topic on the forum, where we look forward to chatting with you!

    If you're interested in learning more about this auto-responder, please read this blog post.

  2. SleeplessByte commented on Jul 26, 2026

    @SleeplessByte
    Member

    If line-up has canonical data in problem-specifications, it may be worth raising there too, since it's shared across tracks.

    @QuentinNev Thanks for your report. The correct approach here would be to raise it there indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions