-
Notifications
You must be signed in to change notification settings - Fork 34
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
Custom pretty printing in utests #778
Conversation
Looks good! But I would also like to have the option to get
|
I propose that we implement that functionality as a library function |
Yes that sounds like a good solution. Can probably be part of a separate PR then |
Changed |
This PR adds the option to supply a function that specifies the output string for the left-hand and right-hand sides of failing utests. The semantics and syntax are best described with an example. The following code snippet:
will on execution output:
The else function has the signature
a -> b -> String
and is only applied to the left-hand side and the right-hand side if a test fails (the standard formatting is omitted in this case). Currently, you always have to specify the custom equality function if you want to also specify the else function due to how the bootparser is implemented. We can relax this later on if we want to.This PR addresses #677.
You can find the above example in test/examples/utest/utest-with-onfail.mc.