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()
  )
})
armcn/maybe documentation built on Aug. 23, 2023, 8:55 p.m.