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_equal() and bang-bang #929

Closed
krlmlr opened this issue Aug 27, 2019 · 0 comments
Closed

expect_equal() and bang-bang #929

krlmlr opened this issue Aug 27, 2019 · 0 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@krlmlr
Copy link
Member

krlmlr commented Aug 27, 2019

expands the vectors during reporting. Tested with 1d04028.

library(testthat)

expect_equal(letters[1:2], LETTERS[1:2])
#> Error: letters[1:2] not equal to LETTERS[1:2].
#> 2/2 mismatches
#> x[1]: "a"
#> y[1]: "A"
#> 
#> x[2]: "b"
#> y[2]: "B"
expect_equal(letters[1:2], !!LETTERS[1:2])
#> Error: letters[1:2] not equal to "A".
#> 2/2 mismatches
#> x[1]: "a"
#> y[1]: "A"
#> 
#> x[2]: "b"
#> y[2]: "B"
#> letters[1:2] not equal to "B".
#> 2/2 mismatches
#> x[1]: "a"
#> y[1]: "A"
#> 
#> x[2]: "b"
#> y[2]: "B"
expect_equal(!!letters[1:2], LETTERS[1:2])
#> Error: "a" not equal to LETTERS[1:2].
#> 2/2 mismatches
#> x[1]: "a"
#> y[1]: "A"
#> 
#> x[2]: "b"
#> y[2]: "B"
#> "b" not equal to LETTERS[1:2].
#> 2/2 mismatches
#> x[1]: "a"
#> y[1]: "A"
#> 
#> x[2]: "b"
#> y[2]: "B"
expect_equal(!!letters[1:2], !!LETTERS[1:2])
#> Error: "a" not equal to "A".
#> 2/2 mismatches
#> x[1]: "a"
#> y[1]: "A"
#> 
#> x[2]: "b"
#> y[2]: "B"
#> "b" not equal to "B".
#> 2/2 mismatches
#> x[1]: "a"
#> y[1]: "A"
#> 
#> x[2]: "b"
#> y[2]: "B"

Created on 2019-08-27 by the reprex package (v0.3.0)

@hadley hadley added the bug an unexpected problem or unintended behavior label Oct 13, 2019
@hadley hadley closed this as completed in 0aa7b19 Oct 13, 2019
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
Projects
None yet
Development

No branches or pull requests

2 participants