Error in `contains_vignette_folder(tar_file)`: Error in untar: file is empty

test_that("contains_vignette_folder handles non-existent file", {
expect_error(contains_vignette_folder("nonexistent_file.tar.gz"), "File does not exist")
expect_error(contains_vignette_folder("eezrfrfrr"), "File does not exist")
# Define the folder structure using the temporary directory
# Step 1: Create the Folder Structure and Multiple .Rmd Files
# Ensure cleanup happens even if the test fails
# Check that the tar file contains .Rmd files
expect_error(contains_vignette_folder(tar_file), "Error in untar: file is empty")
test_that("correct repo with Non-tar file throws an error", {
rmd_file <- file.path(sub_dir, paste0("sample_", i, ".Rmd"))
writeLines(c(paste0("# Sample R Markdown ", i), "", "This is a sample R Markdown file."), rmd_file)
expect_error(contains_vignette_folder(tar_file), "Unsupported file type. Please provide a .tar file.")
test_that("test on package with vignette folder", {
test_that("test on package without vignette folder", {
test_that("test on package with vignette folder but no .rmd file", {
test_that("test on package with inst/doc and .Rmd", {
rmd_file <- file.path(subsub_dir, paste0("sample_", i, ".Rmd"))
test_that("test on package with inst/doc and no .Rmd", {
test_that("test on package with both inst/doc and vignette with .Rmd", {
rmd_file <- file.path(sub_dir_vignette, paste0("sample_", i, ".Rmd"))
test_that("test on package with both inst/doc and vignette without .Rmd", {

"correct repo with Non-tar file throws an error"
"Unsupported file type. Please provide a .tar file."
"test on package without vignette folder"
"test on package with vignette folder but no .rmd file"
"test on package with inst/doc and .Rmd"
"test on package with inst/doc and no .Rmd"
"test on package with both inst/doc and vignette with .Rmd"
"test on package with both inst/doc and vignette without .Rmd"

test on package with vignette folder but no .rmd file

test on package with inst/doc and no .Rmd

test on package with both inst/doc and vignette with .Rmd

test on package with both inst/doc and vignette without .Rmd