Skip to content

all-your-base: exception messages and empty/leading-zero handling the tests require are not documented #3185

Closed

Description

@Mike-7777777

Three things the all-your-base tests check are not stated anywhere in the exercise:

  • The eight error tests (BaseConverterTest.java:130-206) assert IllegalArgumentException with an exact message: "Bases must be at least 2." (six tests, for both bases), "Digits may not be negative." and "All digits must be strictly less than the base.".
  • empty list (:90-97) expects new int[]{} to convert to [0].
  • multiple zeros and leading zeros (:110-127) expect leading zeros to be accepted.

instructions.md only explains positional notation, there is no instructions.append.md, and the stub gives no hint. Earlier versions of these tests required the opposite for the last two points ("You must supply at least one digit.", "Digits may not contain leading zeros."), so a student who remembers them fails three tests without knowing why.

Proposed fix: add .docs/instructions.append.md with an "Input format" section and an "Exception messages" section in the same format as pov. Tests and the example solution stay unchanged. PR: #3183.

Activity

  1. kahgoh commented on Nov 23, 2026

    @kahgoh
    Member

    Closing as unplanned because Exercism uses TDD. Seeing the test output or reading the test is part of the practice.

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