context("asDecomposedPath-1")
test_that("asDecomposedPath", {
path <- c(
".",
"..",
"dir_a/",
"dir_b/",
"dir_b/sub_1/",
"dir_b/sub_1/file.txt",
"dir_b/nonex/",
"dir_b/nonex/file.txt",
"nonex/",
"nonex/sub_1/",
"nonex/sub_1/file.txt",
"nonex/foo.tgz",
"another nonex\\file.tar.gz",
"a_file",
"quux. quuux.tbz2",
"~/file.tar.xz",
"",
NA_character_
)
## character //
expected <- decomposePath(path= path)
expect_equal(res <- asDecomposedPath(path = path), expected)
expected <- decomposePath(path= path, dir_slash = TRUE)
expect_equal(res <- asDecomposedPath(path = path, dir_slash = TRUE), expected)
expected <- decomposePath(path= path, shortform = TRUE)
expect_equal(res <- asDecomposedPath(path = path, shortform = TRUE), expected)
## DirectoryPath.S3 //
expected <- decomposePath(path= path)
expect_equal(res <- asDecomposedPath(path = asDirectoryPath(path)), expected)
## FilePath.S3 //
expected <- decomposePath(path= path)
expect_equal(res <- asDecomposedPath(path = asFilePath(path)), expected)
## DecomposedPath.S3 //
expected <- decomposePath(path= path)
expect_equal(res <- asDecomposedPath(path = decomposePath(path)), expected)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.