From cfcbafe059e6e7984003153dbe32cca4c24c0d06 Mon Sep 17 00:00:00 2001 From: Emily de la Rua Date: Mon, 6 Nov 2023 18:04:19 -0500 Subject: [PATCH 1/2] Remove hard-coding of `.stats` in `count_occurrences` --- tests/testthat/test-table_dst01.R | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/testthat/test-table_dst01.R b/tests/testthat/test-table_dst01.R index a122e3d2..2796adec 100644 --- a/tests/testthat/test-table_dst01.R +++ b/tests/testthat/test-table_dst01.R @@ -28,7 +28,6 @@ testthat::test_that("DST01 default variant is produced correctly", { ) %>% count_occurrences( "EOSSTT", - .stats = "count_fraction", show_labels = "hidden" ) %>% analyze_vars( @@ -53,7 +52,6 @@ testthat::test_that("DST01 variants 2 and 3 are produced correctly", { ) %>% count_occurrences( "EOSSTT", - .stats = "count_fraction", show_labels = "hidden" ) %>% split_rows_by("DCSREASGP", indent_mod = 1L) %>% @@ -77,7 +75,6 @@ testthat::test_that("DST01 variants 2 and 3 are produced correctly", { ) %>% count_occurrences( "EOTSTT", - .stats = "count_fraction", show_labels = "hidden" ) From e3acf425ee2ddd36ab4c2403ae9730034f2d3ecd Mon Sep 17 00:00:00 2001 From: Emily de la Rua Date: Mon, 6 Nov 2023 18:04:48 -0500 Subject: [PATCH 2/2] Suppress error messages in table pagination tests --- tests/testthat/test-pagination_table.R | 4 ++-- tests/testthat/test-table_aet03.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-pagination_table.R b/tests/testthat/test-pagination_table.R index c73b7bf6..2dcec3c3 100644 --- a/tests/testthat/test-pagination_table.R +++ b/tests/testthat/test-pagination_table.R @@ -97,14 +97,14 @@ testthat::test_that("Pagination works also if table is decorated", { # title (2) + subtitle (3) + empty line (1) + div (1) + header (3) + # + nrows (x) + ref footnote (3) + footer (1+2 empty lines) + prov footer (4) testthat::expect_silent(paginate_table(raw_result, lpp = 13)) - testthat::expect_error(paginate_table(raw_result, lpp = 12)) + testthat::expect_error(suppressMessages(paginate_table(raw_result, lpp = 12))) # base is: 20 + x [x from paginate_table(raw_result) is min 13 - 3 (header)] # -> 30 # for pagination with decoration and no wrapping we expect 27 lpp_min <- 28 # -2 less because of ref fnotes cpp_min <- 72 # 70 is the std now, this table is 72 testthat::expect_silent(paginate_table(res, lpp = lpp_min, cpp = cpp_min)) - testthat::expect_error(paginate_table(res, lpp = lpp_min - 1, cpp = cpp_min)) + testthat::expect_error(suppressMessages(paginate_table(res, lpp = lpp_min - 1, cpp = cpp_min))) # for clw above this is 42 (15 more lines due to wrapping) lpp_min <- 42 diff --git a/tests/testthat/test-table_aet03.R b/tests/testthat/test-table_aet03.R index fcde3ede..bae053ea 100644 --- a/tests/testthat/test-table_aet03.R +++ b/tests/testthat/test-table_aet03.R @@ -88,7 +88,7 @@ testthat::test_that("AET03 variant 1 is produced correctly", { # With 8, it works perfectly for the first block but others have much more nesting lpp_test <- 8 testthat::expect_error( - paginate_table(result, lpp = lpp_test)[[1]] + suppressMessages(paginate_table(result, lpp = lpp_test)[[1]]) ) pag_result <- paginate_table(result, lpp = 16)