tests/testthat/test-csv.R

if (interactive()) pkgload::load_all()
testthat::test_that("foo", {
    unlink(dir(tempdir(), full.names = TRUE))
    f <- file.path(tempdir(), paste0("a", ".csv"))
    cars <- mtcars[1:2, TRUE]
    a <- write_csv(cars, file = f)
    testthat::expect_true(file.exists(f))
    testthat::expect_identical(strip_off_attributes(get_path(a)), f)
    p <- get_path(a)
    g <- paste0(f, "g")
    testthat::expect_failure(testthat::expect_identical(strip_off_attributes(p),
                                                        g))
}
)

Try the fritools package in your browser

Any scripts or data that you put into this service are public.

fritools documentation built on Nov. 19, 2023, 1:06 a.m.