From 86083d376eae06a53c198b61e25b13009380b7ef Mon Sep 17 00:00:00 2001 From: Jim Thorson Date: Thu, 1 Feb 2024 17:32:57 -0800 Subject: [PATCH] adding expect_equal for new test --- tests/testthat/test-platform.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-platform.R b/tests/testthat/test-platform.R index e014be3..bba92df 100644 --- a/tests/testthat/test-platform.R +++ b/tests/testthat/test-platform.R @@ -82,9 +82,16 @@ test_that("dsem adds variances ", { data = ts( log(isle_royale[,2:3]), start=1959) sem = " + wolves <-> wolves, 0, sd1 + moose <-> moose, 0, sd2 " # initial first without delta0 (to improve starting values) - fit = dsem( sem = sem, + fit1 = dsem( sem = "", tsdata = data ) + # initial first without delta0 (to improve starting values) + fit2 = dsem( sem = sem, + tsdata = data ) + # Check objective function + expect_equal( as.numeric(fit1$opt$obj), as.numeric(fit2$opt$obj), tolerance=1e-2 ) })