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

suggestion: reword "x should equal y" to "expected y\ninstead got x" or similar #28

Open
namedots opened this issue Sep 4, 2023 · 1 comment

Comments

@namedots
Copy link

namedots commented Sep 4, 2023

the current wording, while correct, seems to clash a bit with beginner expectations, it can easily be misread as "given input x, expected y"

the (especially beginner) solver is likely not even aware of what the assertion looks like, and therefore doesn't have the context for the message

@hobovsky
Copy link

hobovsky commented Sep 5, 2023

While I agree with you and whenever given a choice, I prefer the "expected/got" kind of messages (for example Scala lets you choose between the two), many different frameworks seem to use "x should equal y". Especially the ones using matchers, where message expresses the matcher used: expected x to be less than/greater than/equal y, expected x to be empty, expected x to be not null, etc.

I agree that "expected x but got y" could be clearer for newbies, and I'd vote to change the message, but maybe there's some special reason behind "x should equal y" in the framework?

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

2 participants