Skip to content
Snippets Groups Projects
Commit 51c9542a authored by Sebastian Henz's avatar Sebastian Henz
Browse files

Test for specific errors and warnings, closes #17

parent 1c3c9f3c
No related branches found
No related tags found
1 merge request!3V2.0
......@@ -11,44 +11,59 @@ mod <- ecxsys(
test_that("error when hormesis_concentration not in concentration", {
errorm <- "hormesis_concentration must equal one of the concentration values."
expect_error(
ecxsys(
effect_tox_observed = c(85, 76, 94, 35, 0),
concentration = c(0, 0.03, 0.3, 3, 10),
hormesis_concentration = 0.4
)
hormesis_concentration = 0.4,
effect_tox_observed = c(85, 76, 94, 35, 0)
),
errorm,
fixed = TRUE
)
expect_error(
ecxsys(
concentration = c(0, 0.03, 0.3, 3, 10),
hormesis_concentration = 30,
effect_tox_observed = c(85, 76, 94, 35, 0)
),
errorm,
fixed = TRUE
)
})
test_that("error when hormesis_index <= 2 or >= (length(concentration))", {
errorm <- paste(
"hormesis_concentration must be greater than the lowest",
"non-control concentration and less than the highest concentration"
)
expect_error(
ecxsys(
concentration = c(0, 0.03, 0.3, 3, 10),
hormesis_concentration = 0,
effect_tox_observed = c(85, 76, 94, 35, 0)
)
),
errorm,
fixed = TRUE
)
expect_error(
ecxsys(
concentration = c(0, 0.03, 0.3, 3, 10),
hormesis_concentration = 0.03,
effect_tox_observed = c(85, 76, 94, 35, 0)
)
),
errorm,
fixed = TRUE
)
expect_error(
ecxsys(
concentration = c(0, 0.03, 0.3, 3, 10),
hormesis_concentration = 10,
effect_tox_observed = c(85, 76, 94, 35, 0)
)
)
expect_error(
ecxsys(
concentration = c(0, 0.03, 0.3, 3, 10),
hormesis_concentration = 30,
effect_tox_observed = c(85, 76, 94, 35, 0)
)
),
errorm,
fixed = TRUE
)
})
......@@ -198,12 +213,17 @@ test_that("effect_tox_env_observed can be left out", {
})
test_that("sys model not converging produces a warning", {
test_that("sys model not converging produces a warning, not an error", {
expect_warning(
ecxsys(
concentration = c(0, 0.1, 0.5, 1, 10, 33),
hormesis_concentration = 0.5,
effect_tox_observed = c(98, 98, 96, 76, 26, 0)
)
),
paste(
"Using a horizontal linear model for sys_tox_mod because the",
"Weibull model did not converge."
),
fixed = TRUE
)
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment