cache$getFolder() not equal to file.path(wrk_dir, my_folder).
1/1 mismatches
x[1]: "D:/temp/RtmpmuIqhl/wrk/relative-folder"
y[1]: "D:\\temp\\RtmpmuIqhl/wrk/relative-folder"

testthat::test_that("Class initialization works fine", {
cache <- fscache::Cache$new(folder_path, force = TRUE)
testthat::test_that("We can use a relative folder", {
cache <- fscache::Cache$new(my_folder, create = FALSE)
cache <- fscache::Cache$new(my_folder, user = FALSE)
testthat::test_that("We can save and load contents into files", {
files <- paste0("data_", contents, ".txt")
# Refute sub-folder starting with a slash
paths <- cache$globPaths(tag_files = TRUE)
paths <- cache$globPaths(folders = TRUE)
testthat::test_that("We can erase the main cache folder", {
cache <- fscache::Cache$new(folder_path, user = FALSE)
cache$saveContents("Some content", paste0("file_", i), suffix = ".txt")
testthat::expect_equal(!!n + 2, !!cache$getNbItems(tag_files = TRUE))
testthat::expect_equal(!!n + 1, !!cache$getNbItems(folders = TRUE))
cache$saveContents(c("", "", ""), dst = files)
testthat::expect_equal(cache$listFolder(suffix = ".txt", extract_name = TRUE),
testthat::expect_equal(cache$listFolder(suffix = ".txt", extract_name = TRUE,
cache$importFiles(files, sub_folder = "foo", action = "move")
files <- file.path(wrk_dir, c("c.txt", "d.csv"))
# Try to import with one destination only
# Import with right number of destinations
files <- file.path(wrk_dir, c("g.tsv", "h.tsv"))
cache$importFiles(files, dst = dst, suffix = suffix)
folder_a <- cache$getFolder(sub_folder = "a")
folder_b <- cache$getFolder(sub_folder = "b")
lifecycle::expect_deprecated(x <- cache$getFolder(sub.folder = 'foo'))
y <- cache$getFolder(sub_folder = 'foo')
lifecycle::expect_deprecated(x <- cache$hasFolder(sub.folder = 'foo'))
lifecycle::expect_deprecated(x <- cache$loadContents(f, sub.folder = 'foo'))
lifecycle::expect_deprecated(x <- cache$getPaths(paths, sub.folder = 'foo'))
y <- cache$getPaths(paths, sub_folder = 'foo')
lifecycle::expect_deprecated(x <- cache$globPaths(sub.folder = 'foo'))
y <- cache$globPaths(sub_folder = 'foo')
lifecycle::expect_deprecated(x <- cache$globPaths(tag.files = TRUE))
lifecycle::expect_deprecated(x <- cache$getNbItems(sub.folder = 'foo'))
y <- cache$getNbItems(sub_folder = 'foo')
lifecycle::expect_deprecated(x <- cache$getNbItems(tag.files = TRUE))
lifecycle::expect_deprecated(x <- cache$pathsExist(paths, sub.folder = 'foo'))
lifecycle::expect_deprecated(x <- cache$tagExists(tag, sub.folder = 'foo'))
lifecycle::expect_deprecated(x <- cache$listFolder(sub.folder = 'foo'))
y <- cache$listFolder(sub_folder = 'foo')
lifecycle::expect_deprecated(x <- cache$listFolder(sub.folder = 'foo',
y <- cache$listFolder(sub_folder = 'foo', remove_suffix = TRUE)
y <- cache$listFolder(sub_folder = 'foo', extract_name = TRUE)
lifecycle::expect_deprecated(x <- cache$listFolder(tag.files = TRUE))

"We can save and load contents into files"