From b297860f8c898b06c2d2a6667ba3e4ced2699e11 Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Tue, 25 Feb 2025 15:53:55 -0500 Subject: [PATCH 1/3] Improve testing --- NAMESPACE | 1 + R/objects.R | 1 + 2 files changed, 2 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index 8df183f..d6fd087 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,4 +8,5 @@ export(knit_print) export(new_tab_list) export(new_tab_tibble) export(print_tablist_pander) +export(vec_ptype_abbr.tab_list) importFrom(knitr,knit_print) diff --git a/R/objects.R b/R/objects.R index 80b319f..e679a14 100644 --- a/R/objects.R +++ b/R/objects.R @@ -27,6 +27,7 @@ new_tab_list <- function(x) { vctrs::new_vctr(x, class = "tab_list") } +#' @export vec_ptype_abbr.tab_list <- function(x, ...) { "tablist" } From 2c521998aeda2d459f609d78729822c353e27336 Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Tue, 25 Feb 2025 15:58:31 -0500 Subject: [PATCH 2/3] Improve testing --- NAMESPACE | 2 +- R/objects.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index d6fd087..2066cfa 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,9 +4,9 @@ S3method(format,tab_list) S3method(knit_print,tab_list) S3method(knit_print,tab_tibble) S3method(print,tab_list) +S3method(vctrs::vec_ptype_abbr,tab_list) export(knit_print) export(new_tab_list) export(new_tab_tibble) export(print_tablist_pander) -export(vec_ptype_abbr.tab_list) importFrom(knitr,knit_print) diff --git a/R/objects.R b/R/objects.R index e679a14..144be13 100644 --- a/R/objects.R +++ b/R/objects.R @@ -27,7 +27,7 @@ new_tab_list <- function(x) { vctrs::new_vctr(x, class = "tab_list") } -#' @export +#' @exportS3Method vctrs::vec_ptype_abbr vec_ptype_abbr.tab_list <- function(x, ...) { "tablist" } From 4dbe0bc0101f398c10129e3accb5dd033f32005e Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Tue, 25 Feb 2025 16:01:37 -0500 Subject: [PATCH 3/3] Improve testing --- R/objects.R | 2 +- tests/testthat/test-knit_print.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/objects.R b/R/objects.R index 144be13..374e259 100644 --- a/R/objects.R +++ b/R/objects.R @@ -29,7 +29,7 @@ new_tab_list <- function(x) { #' @exportS3Method vctrs::vec_ptype_abbr vec_ptype_abbr.tab_list <- function(x, ...) { - "tablist" + "tab_list" } #' @export diff --git a/tests/testthat/test-knit_print.R b/tests/testthat/test-knit_print.R index 8fb284a..9f7f082 100644 --- a/tests/testthat/test-knit_print.R +++ b/tests/testthat/test-knit_print.R @@ -7,7 +7,7 @@ test_that("knit_print.tab_tibble (and implicitly knit_print.tab_list and print_t ) |> new_tab_tibble() expect_output( - knit_print(d_tab), + suppressWarnings(knit_print(d_tab)), regexp = "Cars with 8 cylinders" ) expect_output(