From 216d1f318cf38eb04d661980fc81eb652ed950ff Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Sun, 11 Aug 2024 14:57:05 -0500 Subject: [PATCH] Fix NONMEM expected output and test message update --- R/nonmemNlmixr2est.R | 2 +- tests/testthat/test-nonmem.R | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/R/nonmemNlmixr2est.R b/R/nonmemNlmixr2est.R index 09913b80..507de0e9 100644 --- a/R/nonmemNlmixr2est.R +++ b/R/nonmemNlmixr2est.R @@ -211,7 +211,7 @@ if (!rxode2::rxGetControl(.ui, "run", TRUE) || is.na(.cmd)) { .minfo("only exported NONMEM control stream/data") - return(invisible()) + return(invisible(.ui)) } if (!file.exists(file.path(.exportPath, .ui$nonmemXml))) { print(file.path(.exportPath, .ui$nonmemXml)) diff --git a/tests/testthat/test-nonmem.R b/tests/testthat/test-nonmem.R index 9781dae9..fe430e6b 100644 --- a/tests/testthat/test-nonmem.R +++ b/tests/testthat/test-nonmem.R @@ -125,6 +125,7 @@ withr::with_tempdir({ }) test_that("NONMEM dsl, full model", { + one.cmt <- function() { ini({ tka <- 0.45 ; label("Ka") @@ -145,16 +146,18 @@ withr::with_tempdir({ cp ~ add(add.sd) }) } + expect_message( - ui <- nlmixr( one.cmt, data=nlmixr2data::Oral_1CPT, est="nonmem", control=nonmemControl(runCommand=NA) ), - regexp="not running NONMEM" + regexp="only exported NONMEM" ) + expect_s3_class(ui, "rxUi") expect_type(ui$nonmemModel, "character") + expect_equal( ui$nonmemModel, paste( @@ -223,6 +226,7 @@ withr::with_tempdir({ collapse="\n" ) ) + }) # pk.turnover.emax3 <- function() {