"x must be a character giving the longitude column name"
"y must be a character giving the latitude column name"
"z must be a character giving the depth column name"
"The value of x does not appear to be a valid column name"
"The value of y does not appear to be a valid column name"
"The value of z does not appear to be a valid column name"
"data in x column is not formatted as numeric"
"data in y column is not formatted as numeric"
"data in z column is not formatted as numeric"
"outline is not a SpatVector or cannot be transformed"
"zeros must be either 'T', 'F', TRUE, or FALSE"
"crsUnits must be a character (e.g., 'dd', 'm')"
"both crsUnits and res must be specified"
"method misspecified. Please choose either 'IDW' or 'OK'"
"nmax cannot exceed number of observations in df"
"model must be character string of either 'Sph', 'Exp', 'Gau', or 'Mat'"
"CRS of 'outline' is unable to be defined."

"site must be a character giving the site column name"
"The value of site does not appear to be a valid column name"
"date must be a character giving the date column name"
"The value of date does not appear to be a valid column name"
"data in date column is not formatted as date"
"depth must be a character giving the depth column name"
"The value of depth does not appear to be a valid column name"
"temp must be a character giving the temp column name"
"The value of temp does not appear to be a valid column name"
"combine must be either 'sites', 'dates', or 'all'"

#genStack test
#load test tif
dat <- rast("inst/extdata/example_raster.tif")
#create incorrect data type
wrong <- data.frame()
#input check
test_that("genStack input data check", {
expect_error(genStack(wrong, by = 1, stop = NULL, save = T, file_name = NULL, file_type = NULL), info = "DEM must be a SpatRaster object. Convert using 'rast' function in package 'terra'.")
expect_error(genStack(dat, by = 0, stop = NULL, save = T, file_name = NULL, file_type = NULL), info = "by can't be zero")
expect_error(genStack(dat, by = m, stop = NULL, save = T, file_name = NULL, file_type = NULL), info = "by value must be numeric.")
expect_error(genStack(dat, by = 1, stop = NULL, save = T, file_name = NULL, file_type = NULL), info = "save must be either 'T', 'F', TRUE, or FALSE")
expect_error(genStack(dat, by = 1, stop = NULL, save = T, file_name = NULL, file_type = NULL), info = "file_name cannot be NULL when save = T")
expect_error(genStack(dat, by = 1, stop = NULL, save = T, file_name = NULL, file_type = NULL), info = "file_type cannot be NULL when save = T")
expect_error(genStack(dat, by = 1, stop = NULL, save = T, file_name = 1, file_type = NULL), info = "file_name must be a character")
expect_error(genStack(dat, by = 1, stop = NULL, save = T, file_name = NULL, file_type = 2), info = "file_type must be a character")
expect_error(genStack(dat, by = 1, stop = NULL, save = T, file_name = NULL, file_type = "bad"), info = "file_type not accepted, use 'gdal(drivers = T)' to see accepted file types")
expect_error(genStack(dat, by = 1, stop = m, save = T, file_name = NULL, file_type = NULL), info = "stop must be numeric")
expect_error(genStack(dat, by = 5, stop = 2, save = T, file_name = NULL, file_type = NULL), info = "stop cannot be less than 'by'")
})
#test output
test_that("genStack output check", {
expect_s4_class(genStack(dat, by = 10, stop = NULL, save = F, file_name = NULL, file_type = NULL), class = "SpatRaster")
})