Skip to content

Commit f50b4e2

Browse files
committed
Add test for get_f() #58 - experiment with tagging JOSS review -- openjournals/joss-reviews#3888
1 parent 714f06c commit f50b4e2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/testthat/test-get_f.R

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Test get_f() function
2+
test_that("get_f() returns a single numeric value",
3+
{
4+
S0.w = 0.5
5+
S1plus.w = 0.944
6+
nages.w = 25
7+
AgeMat.w = 18
8+
InitDepl.w = 0.9
9+
z.w = 2.39
10+
lambdaMax.w = 1.04
11+
12+
NPROut <- npr(S0 = S0.w, S1plus = S1plus.w,
13+
nages = nages.w, AgeMat = AgeMat.w, E = 0)
14+
N0 <- NPROut$npr # mature numbers per recruit
15+
P0 <- NPROut$P1r # 1+ nums per recruit
16+
17+
# Get bycatch mortality rate for the initial depletion defined above
18+
x <- get_f(f.start = 0.1,
19+
S0.w = S0.w, S1plus.w = S1plus.w, nages.w = nages.w, AgeMat.w = AgeMat.w,
20+
InitDepl.w = InitDepl.w, z.w = z.w, lambdaMax.w = lambdaMax.w,
21+
N0.w = N0, P0.w = P0, Check = FALSE)
22+
print(x)
23+
expect_true(is.numeric(x))
24+
})

0 commit comments

Comments
 (0)