tests/testthat/test-function-.DollarNames.pathlist.R

test_that(".DollarNames.pathlist() works", {

  f <- pathlist:::.DollarNames.pathlist
  pl <- pathlist::pathlist(c("a/bar", "a/beer", "a/bear"))
  expect_error(f())
  expect_identical(f(pl, "b"), c("bar", "beer", "bear"))
  expect_identical(f(pl, "c"), character(0))
})
hsonne/pathlist documentation built on Nov. 4, 2019, 1:47 p.m.