Skip to content

Commit 8d90bc5

Browse files
committed
add test for rebuild_by_x()
1 parent 3d0f06d commit 8d90bc5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/testthat/test-rebuild_by_x.R

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# test rebuild by x
2+
test_that("Check that errors produced when depletion outside of bounds",
3+
{
4+
expect_error(rebuild_by_x(
5+
needf.start = 0.001,
6+
init.depl.w = 1.01, goal.w = 4500,
7+
desired.prob.w = 0.8, when.w = 100,
8+
lh.params.w = list(
9+
S0 = 0.944, S1plus = 0.99,
10+
AgeMat = 17, nages = 19,
11+
z = 2.39, lambdaMax = 1.04, K1plus = 9000
12+
),
13+
fixed.cv.catch.w = 0
14+
))
15+
})
16+
17+
test_that("Check that errors produced when params outside of bounds",
18+
{
19+
expect_error(rebuild_by_x(
20+
needf.start = 0.001,
21+
init.depl.w = 0.6, goal.w = 4500,
22+
desired.prob.w = 1.01, when.w = 100,
23+
lh.params.w = list(
24+
S0 = 0.944, S1plus = 0.99,
25+
AgeMat = 17, nages = 19,
26+
z = 2.39, lambdaMax = 1.04, K1plus = 9000
27+
),
28+
fixed.cv.catch.w = 0
29+
))
30+
})

0 commit comments

Comments
 (0)