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

expect_setequal error message is reversed #1962

Closed
ambevill opened this issue May 16, 2024 · 2 comments · Fixed by #2015
Closed

expect_setequal error message is reversed #1962

ambevill opened this issue May 16, 2024 · 2 comments · Fixed by #2015
Labels
bug an unexpected problem or unintended behavior conditions
Milestone

Comments

@ambevill
Copy link

When expect_setequal fails, the labels are reversed:

Only in expected: {values that are only in the object}
Only in actual: {values that are only in the expected}

Test case:

testthat::expect_setequal(object = 'actual', expected = 'expected')
Error: sample(c("actual", letters)) (`actual`) and sample(c("expected", letters)) (`expected`) don't have the same values.
* Only in `expected`: "actual"
* Only in `actual`: "expected"

A more complex test case:

testthat::expect_setequal(
  object = sample(c('actual', letters)),
  expected = sample(c('expected', letters)))

...gives the same result.

testthat 3.2.1.1 Windows binary R 4.2.2

@ambevill
Copy link
Author

ambevill commented May 16, 2024

@hadley hadley added bug an unexpected problem or unintended behavior conditions labels Oct 22, 2024
@hadley
Copy link
Member

hadley commented Oct 22, 2024

I am so bad at these 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior conditions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants