diff --git a/tests/testthat/_snaps/pagination_table.md b/tests/testthat/_snaps/pagination_table.md index f4d950c9..caed71a6 100644 --- a/tests/testthat/_snaps/pagination_table.md +++ b/tests/testthat/_snaps/pagination_table.md @@ -45,9 +45,9 @@ titles ————————————————————————————————————————————— - SOME A: Drug B: C: Combina - TOPLEFT X Placebo tion - (N=134) (N=134) (N=132) + A: Drug B: C: Combina + SOME X Placebo tion + TOPLEFT (N=134) (N=134) (N=132) ————————————————————————————————————————————— - Any 122 123 120 Grade - (91.0%) (91.8%) (90.9%) @@ -80,7 +80,7 @@ - 50 45 63 (47.7%) Any (37.3%) (33.6%) Grad - e + e - Grad 50 45 63 (47.7%) e (37.3%) (33.6%) 1-2 @@ -92,7 +92,7 @@ - 48 48 50 (37.9%) Any (35.8%) (35.8%) Grad - e + e - Grad 48 48 50 (37.9%) e (35.8%) (35.8%) 1-2 @@ -122,9 +122,9 @@ titles ————————————————————————————————————————————— - SOME A: Drug B: C: Combina - TOPLEFT X Placebo tion - (N=134) (N=134) (N=132) + A: Drug B: C: Combina + SOME X Placebo tion + TOPLEFT (N=134) (N=134) (N=132) ————————————————————————————————————————————— cl D.1 - Any 79 67 80 (60.6%) @@ -141,7 +141,7 @@ - 48 42 50 (37.9%) Any (35.8%) (31.3%) Grad - e + e - Grad 48 42 50 (37.9%) e (35.8%) (31.3%) 3-4 @@ -160,7 +160,7 @@ - 47 58 57 (43.2%) Any (35.1%) (43.3%) Grad - e + e - Grad 47 58 57 (43.2%) e (35.1%) (43.3%) 1-2 @@ -177,7 +177,7 @@ - 47 49 43 (32.6%) Any (35.1%) (36.6%) Grad - e + e - Grad 47 49 43 (32.6%) e 5 (35.1%) (36.6%) ————————————————————————————————————————————— @@ -201,9 +201,9 @@ titles ————————————————————————————————————————————— - SOME A: Drug B: C: Combina - TOPLEFT X Placebo tion - (N=134) (N=134) (N=132) + A: Drug B: C: Combina + SOME X Placebo tion + TOPLEFT (N=134) (N=134) (N=132) ————————————————————————————————————————————— cl A.1 - Any 78 75 89 (67.4%) @@ -220,7 +220,7 @@ - 48 48 50 (37.9%) Any (35.8%) (35.8%) Grad - e + e - Grad 48 48 50 (37.9%) e (35.8%) (35.8%) 1-2 @@ -254,8 +254,8 @@ titles —————————————————————————————————————————————————————————————— - SOME TOPLEFT A: Drug X B: Placebo C: Combination - (N=134) (N=134) (N=132) + A: Drug X B: Placebo C: Combination + SOME TOPLEFT (N=134) (N=134) (N=132) —————————————————————————————————————————————————————————————— cl C.1 - Any Grade - 43 (32.1%) 46 (34.3%) 43 (32.6%) @@ -293,8 +293,8 @@ titles —————————————————————————————————————————————————————————————— - SOME TOPLEFT A: Drug X B: Placebo C: Combination - (N=134) (N=134) (N=132) + A: Drug X B: Placebo C: Combination + SOME TOPLEFT (N=134) (N=134) (N=132) —————————————————————————————————————————————————————————————— cl C.1 - Any Grade - 43 (32.1%) 46 (34.3%) 43 (32.6%) @@ -332,8 +332,8 @@ titles ——————————————————————————————————————————————————————————————————— - SOME TOPLEFT A: Drug X B: Placebo C: Combination - (N=134) (N=134) (N=132) + A: Drug X B: Placebo C: Combination + SOME TOPLEFT (N=134) (N=134) (N=132) ——————————————————————————————————————————————————————————————————— - Any Grade - 122 (91.0%) 123 (91.8%) 120 (90.9%) Grade 1-2 13 (9.7%) 19 (14.2%) 11 (8.3%) @@ -444,8 +444,8 @@ titles —————————————————————————————————————————————————————————————— - SOME TOPLEFT A: Drug X B: Placebo C: Combination - (N=134) (N=134) (N=132) + A: Drug X B: Placebo C: Combination + SOME TOPLEFT (N=134) (N=134) (N=132) —————————————————————————————————————————————————————————————— cl D.2 - Any Grade - 47 (35.1%) 58 (43.3%) 57 (43.2%) @@ -478,8 +478,8 @@ titles —————————————————————————————————————————————————————————————— - SOME TOPLEFT A: Drug X B: Placebo C: Combination - (N=134) (N=134) (N=132) + A: Drug X B: Placebo C: Combination + SOME TOPLEFT (N=134) (N=134) (N=132) —————————————————————————————————————————————————————————————— cl C.2 - Any Grade - 35 (26.1%) 48 (35.8%) 55 (41.7%) @@ -527,8 +527,8 @@ titles —————————————————————————————————————————————————————————————— - SOME TOPLEFT A: Drug X B: Placebo C: Combination - (N=134) (N=134) (N=132) + A: Drug X B: Placebo C: Combination + SOME TOPLEFT (N=134) (N=134) (N=132) —————————————————————————————————————————————————————————————— cl C.2 - Any Grade - 35 (26.1%) 48 (35.8%) 55 (41.7%) diff --git a/tests/testthat/_snaps/table_adat03.md b/tests/testthat/_snaps/table_adat03.md index a607effc..629b64b9 100644 --- a/tests/testthat/_snaps/table_adat03.md +++ b/tests/testthat/_snaps/table_adat03.md @@ -3,10 +3,9 @@ Code res Output - Treatment Group - Visit Total Number Samples with - of Measurable Concentration - Samples {1} Mean SD Median Minimum Maximum CV (%) Geometric Mean ≤ 15μg/mL {2} + Total Number Samples with + Treatment Group of Measurable Concentration + Visit Samples {1} Mean SD Median Minimum Maximum CV (%) Geometric Mean ≤ 15μg/mL {2} ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— A: Drug X (N=536) Day 1 402 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 NA NA 402 (100%) diff --git a/tests/testthat/_snaps/table_aet01_aesi.md b/tests/testthat/_snaps/table_aet01_aesi.md index 58885c47..58673733 100644 --- a/tests/testthat/_snaps/table_aet01_aesi.md +++ b/tests/testthat/_snaps/table_aet01_aesi.md @@ -118,8 +118,8 @@ Code res Output - Standardized MedDRA Query A: Drug X B: Placebo C: Combination - (N=134) (N=134) (N=132) + A: Drug X B: Placebo C: Combination + Standardized MedDRA Query (N=134) (N=134) (N=132) —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— C.1.1.1.3/B.2.2.3.1 AESI (BROAD) Total number of patients with at least one AE 58 (43.3%) 60 (44.8%) 66 (50.0%) diff --git a/tests/testthat/_snaps/table_aet02.md b/tests/testthat/_snaps/table_aet02.md index 4cf25f15..7857414a 100644 --- a/tests/testthat/_snaps/table_aet02.md +++ b/tests/testthat/_snaps/table_aet02.md @@ -157,8 +157,8 @@ Code res Output - MedDRA Preferred Term A: Drug X B: Placebo C: Combination - (N=134) (N=134) (N=132) + A: Drug X B: Placebo C: Combination + MedDRA Preferred Term (N=134) (N=134) (N=132) ———————————————————————————————————————————————————————————————————————————————————————————————————— Total number of patients with at least one adverse event 100 (74.6%) 98 (73.1%) 103 (78.0%) Total number of events 502 480 604 diff --git a/tests/testthat/_snaps/table_aet06.md b/tests/testthat/_snaps/table_aet06.md index 11f67b2f..452a4716 100644 --- a/tests/testthat/_snaps/table_aet06.md +++ b/tests/testthat/_snaps/table_aet06.md @@ -46,9 +46,9 @@ Code res Output - Body System or Organ Class A: Drug X B: Placebo C: Combination - Dictionary-Derived Term <18.5 18.5 - 24.9 25 - 29.9 >30 <18.5 18.5 - 24.9 25 - 29.9 >30 <18.5 18.5 - 24.9 25 - 29.9 >30 - (N=44) (N=17) (N=11) (N=62) (N=37) (N=18) (N=10) (N=69) (N=28) (N=20) (N=18) (N=66) + A: Drug X B: Placebo C: Combination + Body System or Organ Class <18.5 18.5 - 24.9 25 - 29.9 >30 <18.5 18.5 - 24.9 25 - 29.9 >30 <18.5 18.5 - 24.9 25 - 29.9 >30 + Dictionary-Derived Term (N=44) (N=17) (N=11) (N=62) (N=37) (N=18) (N=10) (N=69) (N=28) (N=20) (N=18) (N=66) ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— Total number of patients with at least one adverse event 41 (93.2%) 14 (82.4%) 11 (100%) 56 (90.3%) 35 (94.6%) 16 (88.9%) 9 (90.0%) 63 (91.3%) 25 (89.3%) 19 (95.0%) 15 (83.3%) 61 (92.4%) Overall total number of events 186 80 66 277 174 89 47 312 137 129 100 337 diff --git a/tests/testthat/_snaps/table_aovt02.md b/tests/testthat/_snaps/table_aovt02.md index 0392db8e..cc3053da 100644 --- a/tests/testthat/_snaps/table_aovt02.md +++ b/tests/testthat/_snaps/table_aovt02.md @@ -3,8 +3,8 @@ Code res Output - Parameter ARM A ARM B ARM C - (N=134) (N=134) (N=132) + ARM A ARM B ARM C + Parameter (N=134) (N=134) (N=132) ——————————————————————————————————————————————————————————————————————————————————————————— Unadjusted comparison n 68 73 62 diff --git a/tests/testthat/_snaps/table_cfbt01.md b/tests/testthat/_snaps/table_cfbt01.md index c256b6b9..dab48763 100644 --- a/tests/testthat/_snaps/table_cfbt01.md +++ b/tests/testthat/_snaps/table_cfbt01.md @@ -3,9 +3,9 @@ Code res Output - Parameter A: Drug X B: Placebo C: Combination - Analysis Visit Change from Change from Change from - Value at Visit Baseline Value at Visit Baseline Value at Visit Baseline + A: Drug X B: Placebo C: Combination + Parameter Change from Change from Change from + Analysis Visit Value at Visit Baseline Value at Visit Baseline Value at Visit Baseline ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— BFI All Questions BASELINE diff --git a/tests/testthat/_snaps/table_cmht01.md b/tests/testthat/_snaps/table_cmht01.md index eaf7e4d9..99a7c104 100644 --- a/tests/testthat/_snaps/table_cmht01.md +++ b/tests/testthat/_snaps/table_cmht01.md @@ -24,8 +24,8 @@ Code res Output - Parameter A: Drug X B: Placebo C: Combination - (N=134) (N=134) (N=132) + A: Drug X B: Placebo C: Combination + Parameter (N=134) (N=134) (N=132) ——————————————————————————————————————————————————————————————————————————————————————————————————— BFI All Questions Responders 57 (42.5%) 65 (48.5%) 50 (37.9%) diff --git a/tests/testthat/_snaps/table_egt01.md b/tests/testthat/_snaps/table_egt01.md index 1926be0d..47dda155 100644 --- a/tests/testthat/_snaps/table_egt01.md +++ b/tests/testthat/_snaps/table_egt01.md @@ -3,10 +3,10 @@ Code res Output - Parameter A: Drug X B: Placebo C: Combination - Analysis Visit Change from Change from Change from - Value at Visit Baseline Value at Visit Baseline Value at Visit Baseline - (N=134) (N=134) (N=134) (N=134) (N=132) (N=132) + A: Drug X B: Placebo C: Combination + Change from Change from Change from + Parameter Value at Visit Baseline Value at Visit Baseline Value at Visit Baseline + Analysis Visit (N=134) (N=134) (N=134) (N=134) (N=132) (N=132) ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— Heart Rate BASELINE diff --git a/tests/testthat/_snaps/table_fstg02.md b/tests/testthat/_snaps/table_fstg02.md index 19b1e43c..a1cb59f1 100644 --- a/tests/testthat/_snaps/table_fstg02.md +++ b/tests/testthat/_snaps/table_fstg02.md @@ -3,8 +3,8 @@ Code res Output - Baseline Risk Factors B: Placebo A: Drug X - Total n n Median (Months) n Median (Months) Hazard Ratio 95% Wald CI + B: Placebo A: Drug X + Baseline Risk Factors Total n n Median (Months) n Median (Months) Hazard Ratio 95% Wald CI ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— All Patients 268 134 NA 134 NA 1.00 (0.69, 1.44) Sex @@ -20,8 +20,8 @@ Code res Output - Baseline Risk Factors Placebo Drug X - Total n n Median (Months) n Median (Months) Hazard Ratio 95% Wald CI + Placebo Drug X + Baseline Risk Factors Total n n Median (Months) n Median (Months) Hazard Ratio 95% Wald CI ——————————————————————————————————————————————————————————————————————————————————————————————————————————————— All Patients 268 134 NA 134 NA 1.00 (0.69, 1.44) Sex @@ -37,8 +37,8 @@ Code res Output - Baseline Risk Factors - Total n Hazard Ratio 90% Wald CI + + Baseline Risk Factors Total n Hazard Ratio 90% Wald CI ————————————————————————————————————————————————————————————————————— All Patients 268 1.00 (0.74, 1.36) Sex @@ -54,8 +54,8 @@ Code res Output - Baseline Risk Factors B: Placebo A: Drug X - Total n n Median (Months) n Median (Months) Hazard Ratio 95% Wald CI + B: Placebo A: Drug X + Baseline Risk Factors Total n n Median (Months) n Median (Months) Hazard Ratio 95% Wald CI ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— All Patients 268 134 NA 134 NA 1.00 (0.69, 1.44) Sex diff --git a/tests/testthat/_snaps/table_lbt01.md b/tests/testthat/_snaps/table_lbt01.md index bb7fa593..4c4918a6 100644 --- a/tests/testthat/_snaps/table_lbt01.md +++ b/tests/testthat/_snaps/table_lbt01.md @@ -3,10 +3,10 @@ Code res Output - Parameter A: Drug X B: Placebo C: Combination - Analysis Visit Change from Change from Change from - Value at Visit Baseline Value at Visit Baseline Value at Visit Baseline - (N=804) (N=804) (N=670) (N=670) (N=792) (N=792) + A: Drug X B: Placebo C: Combination + Change from Change from Change from + Parameter Value at Visit Baseline Value at Visit Baseline Value at Visit Baseline + Analysis Visit (N=804) (N=804) (N=670) (N=670) (N=792) (N=792) —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— Alanine Aminotransferase Measurement BASELINE diff --git a/tests/testthat/_snaps/table_lbt09.md b/tests/testthat/_snaps/table_lbt09.md index 85fbb74a..287b66dc 100644 --- a/tests/testthat/_snaps/table_lbt09.md +++ b/tests/testthat/_snaps/table_lbt09.md @@ -3,8 +3,8 @@ Code res Output - Liver Laboratory Test Criterion A: Drug X B: Placebo C: Combination - BASELINE POST-BASELINE BASELINE POST-BASELINE BASELINE POST-BASELINE + A: Drug X B: Placebo C: Combination + Liver Laboratory Test Criterion BASELINE POST-BASELINE BASELINE POST-BASELINE BASELINE POST-BASELINE ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— Total Bilirubin <= 2xULN ALT >3 - <= 5xULN 23/134 (17.2%) 15/134 (11.2%) 25/134 (18.7%) 27/134 (20.1%) 27/132 (20.5%) 30/132 (22.7%) @@ -48,8 +48,8 @@ Code res Output - Liver Laboratory Test Criterion A: Drug X B: Placebo C: Combination - BASELINE POST-BASELINE BASELINE POST-BASELINE BASELINE POST-BASELINE + A: Drug X B: Placebo C: Combination + Liver Laboratory Test Criterion BASELINE POST-BASELINE BASELINE POST-BASELINE BASELINE POST-BASELINE ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— Total Bilirubin <= 2xULN ALT >3 - <= 5xULN 23/134 (17.2%) 15/134 (11.2%) 25/134 (18.7%) 27/134 (20.1%) 27/132 (20.5%) 30/132 (22.7%) diff --git a/tests/testthat/_snaps/table_onct05.md b/tests/testthat/_snaps/table_onct05.md index 5b8ffd01..09ef5645 100644 --- a/tests/testthat/_snaps/table_onct05.md +++ b/tests/testthat/_snaps/table_onct05.md @@ -3,8 +3,8 @@ Code res Output - Baseline Risk Factors B: Placebo A: Drug X - Total n n Response (%) n Response (%) Odds Ratio 95% CI + B: Placebo A: Drug X + Baseline Risk Factors Total n n Response (%) n Response (%) Odds Ratio 95% CI ———————————————————————————————————————————————————————————————————————————————————————————————————————— All Patients 200 100 71.0% 100 90.0% 3.68 (1.68, 8.04) Sex @@ -19,8 +19,8 @@ Code res Output - Baseline Risk Factors B: Placebo A: Drug X - Total n n Response (%) n Response (%) Odds Ratio 95% CI + B: Placebo A: Drug X + Baseline Risk Factors Total n n Response (%) n Response (%) Odds Ratio 95% CI —————————————————————————————————————————————————————————————————————————————————————————————————————————— All Patients 200 100 71.0% 100 90.0% 3.68 (1.68, 8.04) Sex @@ -36,8 +36,8 @@ Code res Output - Baseline Risk Factors - Total n Odds Ratio 90% CI p-value (Chi-Squared Test) + + Baseline Risk Factors Total n Odds Ratio 90% CI p-value (Chi-Squared Test) ——————————————————————————————————————————————————————————————————————————————————————————— All Patients 200 3.68 (1.91, 7.09) 0.0007 Sex @@ -52,8 +52,8 @@ Code res Output - Baseline Risk Factors B: Placebo A: Drug X - Total n n Response (%) n Response (%) Odds Ratio 95% CI + B: Placebo A: Drug X + Baseline Risk Factors Total n n Response (%) n Response (%) Odds Ratio 95% CI —————————————————————————————————————————————————————————————————————————————————————————————————————————— All Patients 200 100 95.0% 100 99.0% 5.21 (0.60, 45.43) Sex diff --git a/tests/testthat/_snaps/table_pkct01.md b/tests/testthat/_snaps/table_pkct01.md index 8bba739d..e4cba959 100644 --- a/tests/testthat/_snaps/table_pkct01.md +++ b/tests/testthat/_snaps/table_pkct01.md @@ -47,11 +47,9 @@ Analyte: Plasma Drug Y Treatment: C: Combination ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— - Cohort/Treatment - Visit - Norminal Time from First Dose Number - of - n s Mean SD CV (%) Mean Geometric Mean CV % Geometric Mean Median Minimum Maximum + Cohort/Treatment Number + Visit of + Norminal Time from First Dose n s Mean SD CV (%) Mean Geometric Mean CV % Geometric Mean Median Minimum Maximum ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— A: Drug X Day 1 diff --git a/tests/testthat/_snaps/table_vst01.md b/tests/testthat/_snaps/table_vst01.md index 652bc054..0d0cbf80 100644 --- a/tests/testthat/_snaps/table_vst01.md +++ b/tests/testthat/_snaps/table_vst01.md @@ -5,8 +5,8 @@ Output A: Drug X B: Placebo C: Combination Change from Change from Change from - Analysis Visit Value at Visit Baseline Value at Visit Baseline Value at Visit Baseline - (N=134) (N=134) (N=134) (N=134) (N=132) (N=132) + Value at Visit Baseline Value at Visit Baseline Value at Visit Baseline + Analysis Visit (N=134) (N=134) (N=134) (N=134) (N=132) (N=132) ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— SCREENING n 134 0 134 0 132 0 diff --git a/tests/testthat/test-pagination_table.R b/tests/testthat/test-pagination_table.R index fae27994..acc23411 100644 --- a/tests/testthat/test-pagination_table.R +++ b/tests/testthat/test-pagination_table.R @@ -106,8 +106,8 @@ testthat::test_that("Pagination works also if table is decorated", { 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)) - # for clw above this is 41 (14 more lines due to wrapping) - lpp_min <- 41 + # for clw above this is 42 (15 more lines due to wrapping) + lpp_min <- 42 pg_tbl_no_clw <- paginate_table(res, lpp = lpp_min, cpp = cpp_min) pg_tbl_w_clw <- paginate_table(res, lpp = lpp_min, colwidths = clw, cpp = cpp_min) testthat::expect_error(paginate_table(res, lpp = lpp_tmp - 1, colwidths = clw, cpp = cpp_min)) diff --git a/tests/testthat/test-table_pkct01.R b/tests/testthat/test-table_pkct01.R index 43d81f69..35d3dd58 100644 --- a/tests/testthat/test-table_pkct01.R +++ b/tests/testthat/test-table_pkct01.R @@ -135,6 +135,6 @@ testthat::test_that("Specific PKCT01 features are present", { testthat::expect_equal(tmp_result, as.character(signif(mean_vals, 3))) # Pagination works roughly - pag_works <- paginate_table(result, verbose = FALSE, lpp = 20) - testthat::expect_equal(length(pag_works), 12L) + pag_works <- paginate_table(result, verbose = FALSE, lpp = 20) # only \n in title is out of lpp + testthat::expect_equal(length(pag_works), 6L) })