tests/testthat/test_isProperlyNamed.R

context("isProperlyNamed")

test_that("isProperlyNamed", {
  expect_true(isProperlyNamed(list()))
  expect_true(isProperlyNamed(list(x=1)))
  expect_true(isProperlyNamed(list(x=1, y=2)))
  expect_true(!isProperlyNamed(list(1,2)))
  xs = list(1,2)
  names(xs)[1] = "a"
  expect_true(!isProperlyNamed(xs))
  names(xs)[2] = "b"
  expect_true(isProperlyNamed(xs))
})

Try the BBmisc package in your browser

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

BBmisc documentation built on Sept. 29, 2022, 5:12 p.m.