tests/testthat/test-not_nan.R

test_that("not_nan returns FALSE if value is NaN", {
  not_nan(NaN) %>% expect_false()
})

test_that("not_nan returns TRUE if value is not NaN", {
  for_all(
    a = anything(),
    property = function(a)
      (isTRUE(identical(a, NaN)) || not_nan(a)) %>%
        expect_true()
  )
})

Try the maybe package in your browser

Any scripts or data that you put into this service are public.

maybe documentation built on Aug. 7, 2023, 5:11 p.m.