tests/test_lengths.R

source("helper/helper.R")

if (exists("lengths", envir = baseenv())) {
  f = get("lengths", envir = baseenv())
  expect_same = makeCompareFun(f, backports:::lengths)

  expect_same(1:3)
  expect_same(setNames(1:3, letters[1:3]))
  expect_same(setNames(1:3, letters[1:3]), use.names = FALSE)
  expect_same(iris)
}

Try the backports package in your browser

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

backports documentation built on June 24, 2024, 5:24 p.m.