Skip to content

Commit

Permalink
use + form for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Sep 14, 2024
1 parent aab14b7 commit 8b06218
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tests/testthat/test-omega.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
test_that("test omega", {

.o <- function(omega, eq="no", len=0, reset=TRUE, unintFixed=TRUE) {
.Call(`_nonmem2rx_setRecord`, "$OMEGA")
if (reset) {
.clearNonmem2rx()
.Call(`_nonmem2rx_omeganum_reset`)
}
lapply(omega, function(o) {
.Call(`_nonmem2rx_trans_omega`, o, "eta", as.integer(unintFixed))
withr::with_options(list(lotri.plusNames=TRUE), {
.Call(`_nonmem2rx_setRecord`, "$OMEGA")
if (reset) {
.clearNonmem2rx()
.Call(`_nonmem2rx_omeganum_reset`)
}
lapply(omega, function(o) {
.Call(`_nonmem2rx_trans_omega`, o, "eta", as.integer(unintFixed))
})
expect_equal(.nonmem2rx$ini, eq)
expect_length(.nonmem2rx$etaLabel, len)
expect_length(.nonmem2rx$etaComment, len)
expect_length(.nonmem2rx$etaNonmemLabel, len)
})
expect_equal(.nonmem2rx$ini, eq)
expect_length(.nonmem2rx$etaLabel, len)
expect_length(.nonmem2rx$etaComment, len)
expect_length(.nonmem2rx$etaNonmemLabel, len)
}

.o("1", "eta1 ~ 1", 1)
Expand Down

0 comments on commit 8b06218

Please sign in to comment.