Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Melkiades committed Nov 29, 2023
1 parent a3d9ae6 commit 281439a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testthat/test-accessors.R
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,20 @@ test_that("header_section_div works", {

expect_true(check_pattern(header_sdiv, "+", nchar(header_sdiv)))
})

test_that("top_level_section_div works", {
tbl <- build_table(lyt, DM)
lyt <- basic_table(top_level_section_div = "a") %>%
split_cols_by("ARM") %>%
split_rows_by("SEX", split_fun = drop_split_levels) %>%
analyze("AGE") %>%
split_rows_by("RACE", split_fun = drop_split_levels) %>%
split_rows_by("SEX", split_fun = drop_split_levels) %>%
analyze("AGE")
expect_identical(top_level_section_div(lyt), "a")
top_level_section_div(lyt) <- "="
expect_identical(top_level_section_div(lyt), "=")
tbl <- build_table(lyt, DM)
top_lev_div_str <- strsplit(toString(tbl), "\n")[[1]][7]
expect_true(check_pattern(top_lev_div_str, "=", nchar(top_lev_div_str)))
})

0 comments on commit 281439a

Please sign in to comment.