Debian Codegraph @

tests/testthat/test-tree.R

raw
1 test_that("dir_tree() works", {
2 withr::with_options(c("cli.unicode" = FALSE), {
3 with_dir_tree(list("foo/1" = ""), {
4 expect_snapshot(dir_tree("foo"))
5 })
6 })
7
8 withr::with_options(c("cli.unicode" = FALSE), {
9 with_dir_tree(
10 list("foo/1" = "", "foo/2" = "", "foo/3" = "", "foo/4" = ""),
11 {
12 expect_snapshot(dir_tree("foo"))
13 }
14 )
15 })
16
17 withr::with_options(c("cli.unicode" = FALSE), {
18 with_dir_tree(
19 list(
20 "foo/bar/1" = "",
21 "foo/bar/baz/2" = "",
22 "foo/qux/3" = "",
23 "foo/4" = ""
24 ),
25 {
26 expect_snapshot(dir_tree("foo"))
27 }
28 )
29 })
30 })