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

Open
ambevill opened this issue May 16, 2024 · 1 comment
Open

expect_setequal error message is reversed #1962

ambevill opened this issue May 16, 2024 · 1 comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant