cursive
cursive copied to clipboard
Expected and actual values are swapped compared to typical Clojure test runners in test diffs
Typically in Clojure tests the expected value comes first and the actual value second.
For example:
(is (= expected actual))
Other test runners then report the expected vs. actual values correctly when the args to = are in that order.
But in Cursive when you view a failed test diff, it puts the first arg in the Actual column and the second arg in the Expected column.
It would be nice if this matched the typical convention of expected first, actual second.
+1, I have this same issue.
For reference, clojure.test never explicitly says you should put expected before actual, but every single example in the docs is written in the form (is (= expected actual)): https://clojure.github.io/clojure/clojure.test-api.html
I just tried to reproduce this, and I couldn't. Cursive doesn't actually say "expected" or "actual" in its diff, it just says "left" and "right". Those values seem to be correctly populated in the diff, i.e. the left hand value appears in the left of the diff, and vice versa. I also can't see that any relevant code has changed since this issue was filed, am I missing something?
It's been long enough I'll have to re-investigate this. But I will do that soon. Thanks!
OK, yeah, it's still happening:
Here's an example is form with the expected value first and the actual value second. This is a de facto standard that most (all?) other test runners rely on:
And here is what Cursive shows when that test fails and you click on <Click to see difference>:
As you can see the expected value is in the "Actual" pane and the actual value is in the "Expected" pane.
Oh, I see - you're talking about the test runner, not the interactive testing in the REPL i.e. this rather than this. Yes, I can see that, I'll fix that.
Fix released in 1.13.4-eap8 on 2024-07-23.
Fix released in 1.13.4-eap8 on 2024-07-23.
Thanks! This is a great improvement! :)
Fix released in 1.13.4 on 2024-08-06.