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

Expected and actual values are swapped compared to typical Clojure test runners in test diffs #2775

Closed
cap10morgan opened this issue Feb 21, 2023 · 8 comments
Labels
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build released-eap Marks issues which have had the fixes released in an EAP build
Milestone

Comments

@cap10morgan
Copy link

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.

@miridius
Copy link

+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

@cursive-ide cursive-ide added this to the 1.13.4 milestone Jun 12, 2024
@cursive-ide
Copy link
Owner

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?

@cap10morgan
Copy link
Author

It's been long enough I'll have to re-investigate this. But I will do that soon. Thanks!

@cap10morgan
Copy link
Author

cap10morgan commented Jul 15, 2024

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:

Screenshot 2024-07-15 at 2 53 44 PM

And here is what Cursive shows when that test fails and you click on <Click to see difference>:

Screenshot 2024-07-15 at 2 53 00 PM

As you can see the expected value is in the "Actual" pane and the actual value is in the "Expected" pane.

@cursive-ide
Copy link
Owner

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.

@cursive-ide cursive-ide added the bug Marks issues describing bugs label Jul 22, 2024
@cursive-ide cursive-ide modified the milestones: 1.13.4, 1.13.4-eap8 Jul 23, 2024
@cursive-ide
Copy link
Owner

Fix released in 1.13.4-eap8 on 2024-07-23.

@cursive-ide cursive-ide added the released-eap Marks issues which have had the fixes released in an EAP build label Jul 23, 2024
@devurandom
Copy link

Fix released in 1.13.4-eap8 on 2024-07-23.

Thanks! This is a great improvement! :)

@cursive-ide
Copy link
Owner

Fix released in 1.13.4 on 2024-08-06.

@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build released-eap Marks issues which have had the fixes released in an EAP build
Projects
None yet
Development

No branches or pull requests

4 participants