Skip to content

Commit

Permalink
Error with wd specified and modName not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Jun 23, 2024
1 parent d1c62b7 commit d408e9a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# rxode2 (development version)

## Breaking Changes

- Error when specifying `wd` without `modName`

# rxode2 2.1.3

## Bug fixes
Expand Down
4 changes: 4 additions & 0 deletions R/rxode2.R
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ rxode2 <- # nolint
verbose = FALSE,
fullPrint=getOption("rxode2.fullPrint", FALSE),
envir=parent.frame()) {
if (!missing(wd) && missing(modName)) {
stop("working directory specified, but modName not declared, need to specify modName to create rxode2 c-files as a sub-directory of `wd`",
call.=FALSE)
}
rxode2parse::.udfEnvSet(envir)
assignInMyNamespace(".rxFullPrint", fullPrint)
rxSuppressMsg()
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-backward.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
rxTest({

test_that("error with wd specified but modName not specified", {

expect_error(rxode2("cp<-cent/vc;d/dt(gutcp)<--ka*gutcp;d/dt(cent)<-(ka*gutcp)-q/vc*cent+q/vp*pericp-((vmax*cp)/vc)/(km+cp);d/dt(pericp)<-cent*q/vc-q/vp*pericp;f(gutcp)=bio;alag(gutcp)<-lag;gutcp(0)<-0;cent(0)<-0;pericp(0)<-0;", wd=getwd()))

})

## Dynmodel routines
ode <- "
dose=200;
Expand Down

0 comments on commit d408e9a

Please sign in to comment.