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

Use Parser.problem instead of Debug.todo #676

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

ceddlyburge
Copy link
Contributor

As per https://forum.exercism.org/t/debug-todo-in-paolas-prestigious-pizza/10596

I ran the existing code locally and it did reproduce the problem reported by Glenn.

I then used Parser.problem instead as suggested, and the test failure messages respond with something useful:

Tests
↓ PaolasPrestigiousPizza
↓ 7
✗ parse a pizza with no ingredients

    Err [{ col = 1, problem = Problem "Please implement this parser", row = 1 }]
    ╷
    │ Expect.equal
    ╵
    Ok { ingredients = [], name = "triste", price = 1, vegetarian = True }

@mpizenberg
Copy link
Member

Sounds like a nice improvement indeed. Circumventing the usage of Debug.todo with function that do not have arguments and making the program crash. Good find!

Copy link
Contributor

@jiegillet jiegillet left a comment

Choose a reason for hiding this comment

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

Beautiful!

@ceddlyburge ceddlyburge merged commit fc34534 into main Apr 4, 2024
7 checks passed
@ceddlyburge ceddlyburge deleted the cb/debug-todo-paolos-pizza branch April 4, 2024 07:38
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