Nothing
test_that("validate_survey_files accepts existing files", {
survey_files <- tempfile(
pattern = "survey_",
fileext = ".rds"
)
file.create(survey_files)
on.exit(unlink(survey_files), add = TRUE)
expect_true(validate_survey_files(survey_files))
})
test_that("validate_survey_files rejects missing files", {
missing_file <- tempfile(fileext = ".rds")
expect_error(
validate_survey_files(missing_file),
"The following files were not found:",
fixed = TRUE
)
})
test_that("validate_survey_files reports actual missing file paths", {
missing_file <- tempfile(fileext = ".rds")
expect_error(
validate_survey_files(missing_file),
missing_file,
fixed = TRUE
)
})
test_that("validate_survey_files handles mixed file availability", {
existing_file <- tempfile(fileext = ".rds")
missing_file <- tempfile(fileext = ".rds")
file.create(existing_file)
on.exit(unlink(existing_file), add = TRUE)
expect_error(
validate_survey_files(c(existing_file, missing_file)),
paste0("The following files were not found: ", missing_file),
fixed = TRUE
)
})
test_that("validate_survey_files accepts multiple existing files", {
survey_files <- tempfile(
pattern = rep("survey_", 3),
fileext = ".rds"
)
file.create(survey_files)
on.exit(unlink(survey_files), add = TRUE)
expect_true(validate_survey_files(survey_files))
})
test_that("validate_survey_files accepts an empty character vector", {
expect_true(validate_survey_files(character(0)))
})
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.