Skip to content

dominoes: make test code more idiomatic#2127

Open
senekor wants to merge 1 commit intomainfrom
senekor/smxkzywyqpnu
Open

dominoes: make test code more idiomatic#2127
senekor wants to merge 1 commit intomainfrom
senekor/smxkzywyqpnu

Conversation

@senekor
Copy link
Contributor

@senekor senekor commented Feb 13, 2026

I've had a mentee copy the "normalize" function from the test code. I didn't notice at first and explained it's unidiomatic to use a match statement only for the guards, because it's just a weird way of writing an if-else-statement.

This version isn't an if-else-statement (which would've been fine too), but I find it the most readable. I have confirmed that the generated assemply is essentially the same, i.e. this doesn't generate two comparison instructions.

[no important files changed]

I've had a mentee copy the "normalize" function from the test code. I
didn't notice at first and explained it's unidiomatic to use a match
statement only for the guards, because it's just a weird way of writing
an if-else-statement.

This version isn't an if-else-statement (which would've been fine too),
but I find it the most readable. I have confirmed that the generated
assemply is essentially the same, i.e. this doesn't generate _two_
comparison instructions.
@github-actions
Copy link
Contributor

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!

@senekor senekor requested a review from ellnix February 13, 2026 00:05
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.

1 participant