Nothing
# WARNING - Generated by {fusen} from dev/flat_import_export.Rmd: do not edit by hand # nolint: line_length_linter.
test_that("export_list writes named files and sub-directories", {
out <- file.path(tempdir(), "test_export_list")
on.exit(unlink(out, recursive = TRUE))
files <- suppressMessages(export_list(list("g1/a" = iris, b = mtcars), path = out))
expect_identical(names(files), c("g1/a", "b"))
expect_identical(files[["g1/a"]], file.path(out, "g1", "a.txt"))
expect_true(all(file.exists(files)))
})
test_that("export_list rejects a data.frame and duplicated targets", {
out <- file.path(tempdir(), "test_export_list_err")
on.exit(unlink(out, recursive = TRUE))
expect_error(export_list(iris, path = out), "list of")
expect_error(suppressMessages(export_list(list(a = iris, A = iris), path = out)),
"same output file")
})
test_that("export_list cannot escape the export directory", {
out <- file.path(tempdir(), "test_export_list_safe")
on.exit(unlink(out, recursive = TRUE))
f <- suppressMessages(export_list(list("../x" = iris), path = out))
expect_identical(f[[1]], file.path(out, "unnamed", "x.txt"))
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.