Archaversine/allen

More useful test failures?

Closed this issue · 2 comments

If possible, I'd really like the failing tests to show what failed and what some the of key values were (e.g., the variables involved in the final comparison). Do you know if there's a way to do this in Haskell? For example, in Common Lisp, there's a command that not only raises and error, but also prints the variable values that are provided. I wonder if it's possible to do something similar in Haskell.

Without this, I ended up needing to write a separate script which basically was a copy of the test case to see what the actually mismatching values were in the test. That seems quite cumbersome to do for every test failure.

For tests that take in parameters, quickCheck will print the parameters that caused a failure. However, for the testcases that do not take in any parameters, no debug information is printed, I will work on a new test function that prints the resulting intervalGraph upon test failure.

Solved by #6. Close when PR is merged.