Skip to content
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

exercises(grains): assert, rather than returning error union #336

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ee7
Copy link
Member

@ee7 ee7 commented Sep 21, 2023

I think that returning an error union here isn't particularly interesting. I think most of the exercises that currently contain (or previously contained) a single-item error set are better if the relevant functions return an optional, or say that it is the caller's responsibility to do input validation.

This PR is a follow-up to 290e7f3, which removed the negative input test case.

Note that we should be able to add the "bad input" tests again in the future - Zig plans to give std.testing the ability to expect a panic.

Merging this PR will break everybody's solution.

Refs: #229

Similar to #335


To-do:

  • Check whether we should add an .append file that explains how to assert

@ee7 ee7 requested a review from booniepepper September 21, 2023 11:36
@ee7 ee7 self-assigned this Oct 5, 2023
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.

2 participants