exercism / problem-specifications

Shared metadata for exercism exercises.
MIT License
320 stars 540 forks source link

roman-numerals: add test with longest output #2414

Closed mpg closed 3 months ago

mpg commented 3 months ago

This matters for languages like C where people need to allocate memory manually for the output.

An example of a mistake this would catch is if someone fails to consider that each arabic digit (except the thousands) can result in up to 4 letters. Or if they correctly compute a maximum of 15 letters but then forget to add 1 for the terminating null byte (in C).

Before this PR, those mistakes would not get caught, as the longest output in existing tests was 9 letters long.

Impact on existing solutions: in a lot of languages this will not matter. In languages with manual memory management, I think solutions that would fail the new test were never correct in the first place.

github-actions[bot] commented 3 months ago

Hello. Thanks for opening a PR on Exercism 🙂

We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in.

You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch.

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


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.