From 0ca199c4a9058d1fb7ad4b7f5c274162d140a6b1 Mon Sep 17 00:00:00 2001 From: Daniel Sabanes Bove Date: Thu, 10 Oct 2024 21:39:17 +0800 Subject: [PATCH] fix error from copilot ... add little test. --- R/utils.R | 2 +- tests/testthat/test-utils.R | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index 9fe80d385..b835f9751 100644 --- a/R/utils.R +++ b/R/utils.R @@ -533,7 +533,7 @@ h_tmb_version_sufficient <- function() { # we can check like this: tmb_config <- TMB::config(DLL = "mmrm") tape_deterministic <- tmb_config$tmbad_deterministic_hash - !is_null(tape_deterministic) + !is.null(tape_deterministic) } #' Warn if TMB is Configured to Use Non-Deterministic Hash for Tape Optimizer diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index cdbd82093..b9ad4dbc7 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -323,6 +323,13 @@ test_that("h_drop_levels works as expected", { ) }) +# h_tmb_version_sufficient ---- + +test_that("h_tmb_version_sufficient works as expected", { + skip_if(utils::packageVersion("TMB") < "1.9.15") + expect_true(h_tmb_version_sufficient()) +}) + # h_tmb_warn_non_deterministic ---- test_that("h_tmb_warn_non_deterministic works as expected", {