Source of `not()`? #185

wibeasley opened this Issue Jan 3, 2014 · 2 comments


None yet
2 participants

wibeasley commented Jan 3, 2014

@wch, what package & version is the not() function from? This test isn't passing on my two machines. My libraries are up-to-date with CRAN, but I'm thinking this is using a development version of some package?

test_that("revalue and mapvalues respect warn_missing", {
  # revalue
  expect_that(revalue("a", c("a"="A")), not(shows_message()))
  expect_that(revalue("a", c("b"="B"), warn_missing=TRUE), shows_message())
  expect_that(revalue("a", c("b"="B"), warn_missing=FALSE), not(shows_message()))

  # mapvalues
  expect_that(mapvalues("a", "a", "A"), not(shows_message()))
  expect_that(mapvalues("a", "b", "B", warn_missing=TRUE), shows_message())
  expect_that(mapvalues("a", "b", "B", warn_missing=FALSE), not(shows_message()))

  # mapvalues with factors
  expect_that(mapvalues(factor("a"), "a", "A"), not(shows_message()))
  expect_that(mapvalues(factor("a"), "b", "B", warn_missing=TRUE), shows_message())
  expect_that(mapvalues(factor("a"), "b", "B", warn_missing=FALSE), not(shows_message()))

hadley commented Jan 3, 2014

It's the dev version of testthat


wibeasley commented Jan 3, 2014

Great. Thanks.

wibeasley closed this Jan 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment