tests/testthat/test-is_nothing.R

test_that("is_nothing returns TRUE for nothing values", {
  nothing() %>% is_nothing() %>% expect_true()
})

test_that("is_nothing returns FALSE for non-nothing values", {
  for_all(
    a = anything(),
    property = function(a) just(a) %>% is_nothing() %>% expect_false()
  )

  for_all(
    a = anything(),
    property = function(a) is_nothing(a) %>% expect_false()
  )
})
armcn/maybe documentation built on Aug. 23, 2023, 8:55 p.m.