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

wordy: Error specification for "what is 52 cubed?" #2083

Open
scmbradley opened this issue Aug 5, 2022 · 0 comments
Open

wordy: Error specification for "what is 52 cubed?" #2083

scmbradley opened this issue Aug 5, 2022 · 0 comments

Comments

@scmbradley
Copy link

scmbradley commented Aug 5, 2022

According to the spec, "What is 52 cubed?" should raise an unknown operation error. "cubed" is an unknown operation so that seems reasonable. However, all the other operations in the exercise are binary operations and "cubed" is unary. So "52 cubed" is also a syntax error in the context of parsing binary operations. (One of the other tests is "What is 1 plus?" which is exactly the same form as "What is 52 cubed?" but here we throw a syntax error).

Thus it seems failing a test for catching the syntax error before the unknown operation error doesn't seem correct. Perhaps both kinds of errors should be permitted?

Suggestions: add a test to catch an unknown binary operation eg. "What is 4 quus 5?", and let "What is 52 cubed?" pass the test if either error message is raised.

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

No branches or pull requests

1 participant