`confidence_grid(...)` threw an error with unexpected message.
Expected match: "'res' must be a positive integer"
Actual message: "unused argument (G = s_sample)"

test_that("confidence_grid: validates inputs correctly", {
tol <- 1e-2 # tolerance for the confidence set
s_obs <- c(1.12, 0.67) # the observed sample mean
seeds <- matrix(rnorm(R * (n + 2)), nrow = R, ncol = n + 2) # pre-generated seeds
raw_data <- theta[1] + sqrt(theta[2]) * seeds[, 1:n]
test_that("confidence_grid: check example in function description", {
tol <- 1e-1 # tolerance for the confidence set
result <- confidence_grid(alpha, lower_bds, upper_bds, seeds, s_sample, s_obs, tol, res)
expect_true(all(c("ind_array", "search_lower_bds", "search_upper_bds") %in% names(result)))

"confidence_grid: check example in function description"

`get_CI(...)` threw an error with unexpected message.
Expected match: "Significance level 'alpha' must be a number"
Actual message: "unused arguments (j = 1, G = s_sample)"

seeds <- matrix(rnorm(R * (n + 2)), nrow = R, ncol = n + 2)
"Significance level 'alpha' must be a number")
"Significance level 'alpha' must be a number between 0 and 1.")
test_that("example in function description runs without issue", {
# use smaller sample size for faster testing
mean_CI <- get_CI(alpha, lower_bds, upper_bds, 1, seeds, s_sample, s_obs, tol)
var_CI <- get_CI(alpha, lower_bds, upper_bds, 2, seeds, s_sample, s_obs, tol)

"Significance level 'alpha' must be a number"
"Significance level 'alpha' must be a number between 0 and 1."
"example in function description runs without issue"

`get_CI(...)` threw an error with unexpected message.
Expected match: "Significance level 'alpha' must be a number between 0 and 1."
Actual message: "unused arguments (j = 1, G = s_sample)"

`get_CI(...)` threw an error with unexpected message.
Expected match: "'tol' must be a positive number."
Actual message: "unused arguments (j = 1, G = s_sample)"

`p_value(...)` threw an error with unexpected message.
Expected match: "Lengths of inputs 'lower_bds' and 'upper_bds' must match."
Actual message: "unused argument (G = s_sample)"