Skip to content

Commit

Permalink
Merge branch 'RXR-1926-duration-scale' of github.com:InsightRX/PKPDsi…
Browse files Browse the repository at this point in the history
…m into RXR-1926-duration-scale
  • Loading branch information
roninsightrx committed Apr 2, 2024
2 parents ccb7003 + 449f4e6 commit 3802a03
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testthat/test_apply_duration_scale.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ reg_iv <- new_regimen(
cmt = c(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2)
)

reg_combo <- new_regimen(
amt = 1000,
n = 4,
interval = 12,
type = c("drug1", "drug2", "oral", "oral"),
cmt = c(2, 3, 1, 1),
t_inf = c(1, 1, 0, 0)
)

## null / error checks
test_that("infusion length NULL warning", {
expect_warning(
Expand Down Expand Up @@ -56,3 +65,11 @@ test_that("infusion length scaled using parameter", {
)
expect_equal(dur3$t_inf, rep(1.6, 12))
})

test_that("infusion length scaled", {
dur4 <- apply_duration_scale(
regimen = reg_combo,
duration_scale = c(1, 1.5, 2)
)
expect_equal(dur4$t_inf, c(1.5, 2, 0))
})

0 comments on commit 3802a03

Please sign in to comment.