tests/testthat/test-utils.R

test_that("'is_empty_atom' and 'failed' work", {
  expect_true(is_empty_atom(character(0)))
  expect_false(is_empty_atom('ab'))
  expect_false(is_empty_atom(list()))
  expect_true(failed(list()))
  expect_false(failed(list('ab')))
  expect_false(failed(character(0)))
  expect_false(failed('ab'))
  expect_false(failed(character(0)))
  expect_false(failed('ab'))
})

test_that("'ensure.list' works", {
  expect_equal(ensure.list(data.frame(a='a')), list(data.frame(a='a')))
})

Try the parcr package in your browser

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

parcr documentation built on June 22, 2024, 10:31 a.m.