Skip to content

FIX: Update test cases where is not correct the expected value.#576

Closed
clouby wants to merge 2 commits intoexercism:mainfrom
clouby:main
Closed

FIX: Update test cases where is not correct the expected value.#576
clouby wants to merge 2 commits intoexercism:mainfrom
clouby:main

Conversation

@clouby
Copy link
Contributor

@clouby clouby commented Dec 26, 2025

Hey Gleam team,

I noticed that the last two test cases about the armstrong_numbers challenge are not correct to the expected value; those cases should have expected a false value.

Also made some tests with external tools that match the expected value:

Test Cases

  • armstrong_number_containing_seven_zeroes_test
  • the_largest_and_last_armstrong_number_test
Screenshot 2025-12-25 at 9 43 03 PM Screenshot 2025-12-25 at 9 43 30 PM

@github-actions
Copy link

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Could you fix the test please 🙏

@clouby
Copy link
Contributor Author

clouby commented Jan 12, 2026

@lpil Done ✅ - Let me know if looking good for you, thanks!

let assert True =
let assert False =
armstrong_numbers.is_armstrong_number(
186_709_961_001_538_790_100_634_132_976_990,
Copy link
Contributor

@jiegillet jiegillet Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to butt in, but I'm pretty sure that this number and the following one are Armstrong numbers (see the comments or example sections, or the full list). I suspect that the site you posted screenshots from uses JS to check the number, and numbers that large are always treated as floats and lose precision.
Similarly, having to introduce Floats in the example solution to make it work seems suspicious to me.

Also, in general, the practice exercises all come from a repo common to all the Exercism tracks, so if there is an issue not linked to the specificity of a track language, it should be solved over there so that all tracks can benefit.

Copy link
Contributor Author

@clouby clouby Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your explanation here, I'll take a look further about Armstrong criteria - I'll close it.

@clouby clouby closed this Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants