Nothing
# WARNING - Generated by {fusen} from dev/flat_utils.Rmd: do not edit by hand # nolint: line_length_linter.
test_that("get_path_info extracts names and segments", {
p <- c("C:/Users/foo/report.xlsx", "/home/u/.bashrc", "rel/a/b.tar.gz", NA)
expect_identical(get_path_info(p), c("report", ".bashrc", "b.tar", NA))
expect_identical(get_path_info(p, n = 1), c("Users", "home", "rel", NA))
expect_identical(get_path_info(p, n = c(-2, -1)),
c("foo/report.xlsx", "u/.bashrc", "a/b.tar.gz", NA))
})
test_that("get_path_info keeps absolute paths absolute", {
p <- c("/a/b.txt", "C:\\x\\y.csv", "\\\\srv\\share\\f.r", "rel/z.gz")
expect_identical(get_path_info(p, rm_path = FALSE),
c("/a/b", "C:/x/y", "//srv/share/f", "rel/z"))
})
test_that("get_path_info validates n", {
expect_error(get_path_info("a/b", n = NA), "without NA")
expect_error(get_path_info("a/b", n = 0), "must not contain 0")
})
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.