-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Sync say
tests
#435
Conversation
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.
For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping |
Closes #274 as well |
There was a problem hiding this 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))] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.