tests/testthat/test-is_just.R

test_that("is_just returns TRUE for just values", {
  for_all(
    a = anything(),
    property = function(a) just(a) %>% is_just() %>% expect_true()
  )
})

test_that("is_just returns FALSE for non-just values", {
  nothing() %>% is_just() %>% expect_false()

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