Skip to content

Commit

Permalink
Add tern:: to utils tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua committed Mar 2, 2023
1 parent f122d65 commit c85816d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
library(dplyr)
library(tern)

pkg_name <- "teal.modules.clinical"
library(pkg_name, character.only = TRUE)
testthat::test_check(pkg_name)
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Code
res
Output
[1] "rtables::basic_table() %>% rtables::split_cols_by(var = \"ARMCD\") %>% test_proportion_diff(vars = \"rsp\", method = \"cmh\", variables = list(strata = \"strat\")) %>% rtables::build_table(df = dta)"
[1] "rtables::basic_table() %>% rtables::split_cols_by(var = \"ARMCD\") %>% tern::test_proportion_diff(vars = \"rsp\", method = \"cmh\", variables = list(strata = \"strat\")) %>% rtables::build_table(df = dta)"

# add_expr adds expressions to expression list

Expand All @@ -17,7 +17,7 @@
rtables::split_cols_by(var = arm)
[[3]]
test_proportion_diff(vars = "rsp", method = "cmh", variables = list(strata = "strat"))
tern::test_proportion_diff(vars = "rsp", method = "cmh", variables = list(strata = "strat"))
[[4]]
rtables::build_table(df = dta)
Expand All @@ -39,7 +39,7 @@
Output
{
anl <- subset(adrs, PARAMCD == "INVET")
anl$rsp_lab <- d_onco_rsp_label(anl$AVALC)
anl$rsp_lab <- tern::d_onco_rsp_label(anl$AVALC)
anl$is_rsp <- anl$rsp_lab %in% c("Complete Response (CR)",
"Partial Response (PR)")
}
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ testthat::test_that("h_concat_expr returns a string for long expression", {
expr <- quote(
rtables::basic_table() %>%
rtables::split_cols_by(var = "ARMCD") %>%
test_proportion_diff(
tern::test_proportion_diff(
vars = "rsp", method = "cmh", variables = list(strata = "strat")
) %>%
rtables::build_table(df = dta)
Expand Down Expand Up @@ -33,7 +33,7 @@ testthat::test_that("add_expr adds expressions to expression list", {
lyt <- add_expr(
lyt,
substitute(
test_proportion_diff(
tern::test_proportion_diff(
vars = "rsp", method = "cmh", variables = list(strata = "strat")
)
)
Expand Down Expand Up @@ -70,7 +70,7 @@ expr1 <- substitute(
expr = anl <- subset(df, PARAMCD == param),
env = list(df = as.name("adrs"), param = "INVET")
)
expr2 <- substitute(expr = anl$rsp_lab <- d_onco_rsp_label(anl$AVALC))
expr2 <- substitute(expr = anl$rsp_lab <- tern::d_onco_rsp_label(anl$AVALC))
expr3 <- substitute(
expr = anl$is_rsp <- anl$rsp_lab %in%
c("Complete Response (CR)", "Partial Response (PR)")
Expand Down

0 comments on commit c85816d

Please sign in to comment.