tests/testthat/test-function-flatten_tree.R

test_that("flatten_tree() works", {

  f <- kwb.fakin:::flatten_tree

  expect_error(f())

  paths <- c("a/b", "a/c", "a/d/e/f")

  capture.output(tree <- kwb.fakin:::to_tree(paths))

  expect_identical(f(paths), paths)
  expect_identical(f(tree), paths)
})
KWB-R/kwb.fakin documentation built on June 14, 2022, 2 p.m.