@@ -5,7 +5,7 @@ test_that("get_f() returns a single numeric value",
5
5
S1plus.w = 0.944
6
6
nages.w = 25
7
7
AgeMat.w = 18
8
- InitDepl.w = 0.9
8
+ InitDepl.w = 0.5
9
9
z.w = 2.39
10
10
lambdaMax.w = 1.04
11
11
@@ -19,6 +19,27 @@ test_that("get_f() returns a single numeric value",
19
19
S0.w = S0.w , S1plus.w = S1plus.w , nages.w = nages.w , AgeMat.w = AgeMat.w ,
20
20
InitDepl.w = InitDepl.w , z.w = z.w , lambdaMax.w = lambdaMax.w ,
21
21
N0.w = N0 , P0.w = P0 , Check = FALSE )
22
- print(x )
23
22
expect_true(is.numeric(x ))
24
23
})
24
+
25
+ test_that(" uniroot() fails if initial depletion = 1" ,
26
+ {
27
+ S0.w = 0.5
28
+ S1plus.w = 0.944
29
+ nages.w = 25
30
+ AgeMat.w = 18
31
+ InitDepl.w = 1
32
+ z.w = 2.39
33
+ lambdaMax.w = 1.04
34
+
35
+ NPROut <- npr(S0 = S0.w , S1plus = S1plus.w ,
36
+ nages = nages.w , AgeMat = AgeMat.w , E = 0 )
37
+ N0 <- NPROut $ npr # mature numbers per recruit
38
+ P0 <- NPROut $ P1r # 1+ nums per recruit
39
+
40
+ # Get bycatch mortality rate for the initial depletion defined above
41
+ expect_error(get_f(f.start = 0.1 ,
42
+ S0.w = S0.w , S1plus.w = S1plus.w , nages.w = nages.w , AgeMat.w = AgeMat.w ,
43
+ InitDepl.w = InitDepl.w , z.w = z.w , lambdaMax.w = lambdaMax.w ,
44
+ N0.w = N0 , P0.w = P0 , Check = FALSE ))
45
+ })
0 commit comments