-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Improvements to EffAssert Logging #6542
Improvements to EffAssert Logging #6542
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very welcome addition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quality changes ⚡
I think I've fixed the conflicts on this but please just triple check it looks how you imagine it ought to! |
looks correct |
Description
Adds the ability to provide expected and received values for an assertion that will be provided in the error message.
For assertions using conditions that implement VerboseAssert (and that don't provide custom expected/got values), EffAssert will automatically grab expected/got messages from the condition itself. This will not work reliably for expressions that change between calls, like random expressions or ExprNow, as the assert effect calls getSingle/getAll a second time. For those scenarios, using a variable or a custom expected/got message is recommended.
So far, only CondCompare and CondIsSet implement VerboseAssert, but any condition that has significant use in tests is a valid target for implementation.
Suggestions are extremely welcome for a better interface name. This is the best kenzie and I could come up with in 5 minutes.
Example:
This PR also adds line numbers to the test error message:
Todo:
Target Minecraft Versions: any
Requirements: none
Related Issues: none