-
Notifications
You must be signed in to change notification settings - Fork 317
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
feature request: add expect_na function #291
Comments
What would you expect |
In my opinion
|
Hmmm, if |
Maybe Though an option for all three to ignore differences in attributes would be On 25 September 2015 at 14:52, Hadley Wickham notifications@github.com
Regards, Learning R http://shop.oreilly.com/product/0636920028352.do |
That just doesn't feel terribly compelling/systematic to me. You might as well do |
Yes, you can always use |
In that case I think you'd be better testing the type of the NA value too. |
You can test for
TRUE
orFALSE
usingexpect_true
andexpect_false
respectively. For completeness, it would be nice to haveexpect_na
for testing for missing values.At the moment, you can do this with
expect_equal(x, NA)
, but this requires a little care since differentNA
s are treated as different. For exampleexpect_equal(NA, NA_character_)
will fail.expect_na
should treat them as the same (or have an argument to specify whether or not they should be considered the same).The text was updated successfully, but these errors were encountered: