Skip to content

Commit

Permalink
Merge pull request #420 from Merck/419-add-developer-test-for-gs_powe…
Browse files Browse the repository at this point in the history
…r_ahr

419 add developer test for gs power ahr
  • Loading branch information
LittleBeannie authored Jun 13, 2024
2 parents 83ae442 + 978d5f7 commit 4a97d17
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: gsDesign2
Title: Group Sequential Design with Non-Constant Effect
Version: 1.1.2.10
Version: 1.1.2.11
Authors@R: c(
person("Keaven", "Anderson", email = "keaven_anderson@merck.com", role = c("aut")),
person("Yilong", "Zhang", email = "elong0527@gmail.com", role = c("aut")),
Expand Down
17 changes: 17 additions & 0 deletions tests/testthat/test-developer-gs_power_ahr.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,20 @@ test_that("calendar + event based cut", {
expect_equal(x1$analysis$info, x2$info[x2$Bound == "Lower"], tolerance = 1e-5)
expect_equal(x1$analysis$info0, x2$info0[x2$Bound == "Lower"], tolerance = 1e-5)
})

test_that("Use default lower and lpar but set test_lower is FALSE", {
# using the default lower and lpar but set test_lower = FALSE,
# which means there is no futility test
x <- gs_power_ahr(analysis_time = c(24, 36),
event = c(50, 100),
test_lower = FALSE)

expect_equal(unique(x$bound$bound), "upper")
})

test_that("Use default lower, lpar and test_lower", {
# using the default lower, lpar and test_lower,
# return an error message asking for total spend for the futility test
expect_error(gs_power_ahr(analysis_time = c(24, 36),
event = c(50, 100)))
})

0 comments on commit 4a97d17

Please sign in to comment.