Skip to content

Sync say tests #435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 7, 2025
Merged

Sync say tests #435

merged 2 commits into from
Aug 7, 2025

Conversation

BNAndras
Copy link
Member

@BNAndras BNAndras commented Aug 6, 2025

I rewrote the test suite to reflect the canonical tests upstream which expect a single say function. That in turn required me to update the stub and example solution.

@BNAndras BNAndras added x:module/practice-exercise Work on Practice Exercises x:rep/large Large amount of reputation labels Aug 6, 2025
Copy link

github-actions bot commented Aug 6, 2025

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!

@BNAndras BNAndras marked this pull request as ready for review August 6, 2025 21:59
@BNAndras
Copy link
Member Author

BNAndras commented Aug 6, 2025

Closes #274 as well

@BNAndras BNAndras requested a review from a team August 6, 2025 22:00
Copy link
Contributor

@blakelewis blakelewis left a comment

Choose a reason for hiding this comment

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

Much better now! Thanks.

(-> (and/c exact-nonnegative-integer? (</c 1e12)) string?)
(if (zero? number)
"zero"
(let* ([digits (string->list (number->string number))]
Copy link
Contributor

Choose a reason for hiding this comment

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

What do we gain by converting the number into lists of characters here and then turning them back into numbers in to-words? Couldn't we get the groups of three using arithmetic, e.g., with quotient/remainder? But since this method works, there is no need to change anything.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was trying to do things in discrete steps, but you're right. Thinking of efficiency, I think the CI should perhaps track the time taken for each example solution as an approximate estimate of how long it'd take the test runner. The example only needs to prove the test suite is solvable, but it'd be nice to know if that's within the 20 seconds available. I've had a few example solutions I wrote elsewhere that worked great on the CI but timed out when submitted. That didn't feel too great.

@BNAndras BNAndras merged commit c4f55b3 into exercism:main Aug 7, 2025
7 checks passed
@BNAndras BNAndras deleted the update-say branch August 7, 2025 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:module/practice-exercise Work on Practice Exercises x:rep/large Large amount of reputation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants