tests/testthat/test-realpath.R

test_that("realpath", {
    tempdir <- tempdir2()
    dir.create(file.path(tempdir, "AAA"))
    file.create(file.path(tempdir, "BBB"))
    path <- c(
        "aaa" = file.path(tempdir, "AAA"),
        "bbb" = file.path(tempdir, "BBB")
    )
    out <- realpath(path)
    expect_named(out)
    expect_identical(basename(out), basename(path))
    unlink2(tempdir)
    expect_error(realpath(path))
})
acidgenomics/acidbase documentation built on Jan. 26, 2024, 4:26 p.m.