From 5202570bdf3b3fa79469249d2f2a293f5a6c7fc4 Mon Sep 17 00:00:00 2001 From: "Aaron A. King" Date: Mon, 9 Dec 2024 08:36:33 -0500 Subject: [PATCH] improve testing --- tests/mif2_index.R | 24 +++++++++++++++++------- tests/mif2_index.Rout.save | 27 ++++++++++++++++++--------- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/tests/mif2_index.R b/tests/mif2_index.R index d520f584..733af055 100644 --- a/tests/mif2_index.R +++ b/tests/mif2_index.R @@ -7,10 +7,12 @@ gompertz() -> gompertz set.seed(1481104436) gompertz |> - mif2(Nmif=4,Np=1000, + mif2( + Nmif=4,Np=1000, .indices=seq.int(1000), rw.sd=rw_sd(r=0.02,K=0.02,sigma=0.02), - cooling.fraction.50=0.5) |> + cooling.fraction.50=0.5 + ) |> slot("indices") -> idx stopifnot( length(idx)==1000, @@ -20,16 +22,24 @@ stopifnot( set.seed(962724905) gompertz |> - mif2(Nmif=4,Np=100, + mif2( + Nmif=4,Np=100, .indices=as.list(seq.int(100)), rw.sd=rw_sd(r=0.02,K=0.02,sigma=0.02), - cooling.fraction.50=0.5) |> + cooling.fraction.50=0.5 + ) |> slot("indices") -> idx stopifnot( length(idx)==100, class(idx)=="list" ) -try(mif2(gompertz,Nmif=1,Np=100, - .indices=1:5,rw.sd=rw_sd(r=0.02,K=0.02,sigma=0.02), - cooling.fraction=0.5)) +try( + mif2( + gompertz, + Nmif=1,Np=100, + .indices=1:5, + rw.sd=rw_sd(r=0.02,K=0.02,sigma=0.02), + cooling.fraction.50=0.5 + ) +) diff --git a/tests/mif2_index.Rout.save b/tests/mif2_index.Rout.save index 89212bd4..f6128823 100644 --- a/tests/mif2_index.Rout.save +++ b/tests/mif2_index.Rout.save @@ -26,10 +26,12 @@ Type 'q()' to quit R. > set.seed(1481104436) > > gompertz |> -+ mif2(Nmif=4,Np=1000, ++ mif2( ++ Nmif=4,Np=1000, + .indices=seq.int(1000), + rw.sd=rw_sd(r=0.02,K=0.02,sigma=0.02), -+ cooling.fraction.50=0.5) |> ++ cooling.fraction.50=0.5 ++ ) |> + slot("indices") -> idx > stopifnot( + length(idx)==1000, @@ -39,19 +41,26 @@ Type 'q()' to quit R. > set.seed(962724905) > > gompertz |> -+ mif2(Nmif=4,Np=100, ++ mif2( ++ Nmif=4,Np=100, + .indices=as.list(seq.int(100)), + rw.sd=rw_sd(r=0.02,K=0.02,sigma=0.02), -+ cooling.fraction.50=0.5) |> ++ cooling.fraction.50=0.5 ++ ) |> + slot("indices") -> idx > stopifnot( + length(idx)==100, + class(idx)=="list" + ) > -> try(mif2(gompertz,Nmif=1,Np=100, -+ .indices=1:5,rw.sd=rw_sd(r=0.02,K=0.02,sigma=0.02), -+ cooling.fraction=0.5)) -Error : in 'mif2': The argument 'cooling.fraction'is not recognized. -Use the 'userdata' argument to supply extra objects to basic model components. See '?userdata'. +> try( ++ mif2( ++ gompertz, ++ Nmif=1,Np=100, ++ .indices=1:5, ++ rw.sd=rw_sd(r=0.02,K=0.02,sigma=0.02), ++ cooling.fraction.50=0.5 ++ ) ++ ) +Error : in 'mif2': '.indices' has improper length. >