Nothing
test_that("valid_file_info returns file metadata", {
path <- tempfile()
writeLines("Test content", path)
on.exit(unlink(path), add = TRUE)
result <- valid_file_info(path)
expect_s3_class(result, "data.frame")
expect_equal(nrow(result), 1L)
expect_gt(result$size, 0)
expect_false(result$isdir)
expect_equal(result, file.info(path))
})
test_that("valid_file_info rejects nonexistent files", {
path <- tempfile()
expect_error(
valid_file_info(path),
"is not a file",
fixed = TRUE
)
})
test_that("valid_file_info rejects directories", {
expect_error(
valid_file_info(tempdir()),
"is not a file",
fixed = TRUE
)
})
test_that("valid_file_info rejects missing file paths", {
expect_error(
valid_file_info(NA_character_),
"is not a file",
fixed = TRUE
)
})
test_that("valid_file_info rejects multiple file paths", {
paths <- c(tempfile(), tempfile())
file.create(paths)
on.exit(unlink(paths), add = TRUE)
expect_error(
valid_file_info(paths),
"is not a file",
fixed = TRUE
)
})
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.