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_equivalent() gives misleading error message #485

Closed
dlindelof opened this issue Jun 21, 2016 · 1 comment
Closed

expect_equivalent() gives misleading error message #485

dlindelof opened this issue Jun 21, 2016 · 1 comment
Milestone

Comments

@dlindelof
Copy link

@dlindelof dlindelof commented Jun 21, 2016

When comparing two objects that are numerically different and have different names, I expect expect_equivalent() to complain about the numeric differences and ignore the names. Instead it reports a difference in the names:

> expect_equivalent(c(foo = 0), 1)
Error: c(foo = 0) not equivalent to 1.
names for target but not for current
> expect_equivalent(c(foo = 0), 0)
@krlmlr krlmlr modified the milestone: 1.0.3 Jul 4, 2016
@krlmlr
Copy link
Member

@krlmlr krlmlr commented Jul 4, 2016

Works as expected for character values already:

> expect_equivalent(c(foo = "0"), "1")
Error: c(foo = "0") not equivalent to "1".
1/1 mismatches
x[1]: "0"
y[1]: "1"
@hadley hadley closed this in cd90427 Jul 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants