Skip to content

Commit

Permalink
Fix NONMEM expected output and test message update
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Aug 11, 2024
1 parent 47cb2a3 commit 216d1f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/nonmemNlmixr2est.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
8 changes: 6 additions & 2 deletions tests/testthat/test-nonmem.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ withr::with_tempdir({
})

test_that("NONMEM dsl, full model", {

one.cmt <- function() {
ini({
tka <- 0.45 ; label("Ka")
Expand All @@ -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(
Expand Down Expand Up @@ -223,6 +226,7 @@ withr::with_tempdir({
collapse="\n"
)
)

})

# pk.turnover.emax3 <- function() {
Expand Down

0 comments on commit 216d1f3

Please sign in to comment.