From 2f7d8301149deffe2a232068af85483b0bef0c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Thu, 23 Mar 2023 09:02:33 +0100 Subject: [PATCH] One test per method, still use generic in snapshot --- tests/testthat/test-capital.R | 4 +- tests/testthat/test-char.R | 55 +++++--- tests/testthat/test-continuation-data.R | 4 +- tests/testthat/test-ctl_new_pillar.R | 18 +++ tests/testthat/test-ctl_new_pillar_list.R | 9 ++ tests/testthat/test-ctl_pillar.R | 8 +- tests/testthat/test-ggplot2.R | 8 +- tests/testthat/test-glimpse.R | 54 ++++++++ tests/testthat/test-multi.R | 39 +++++- tests/testthat/test-num.R | 98 +++++++++++---- tests/testthat/test-ornament.R | 8 +- tests/testthat/test-pillar.R | 8 +- tests/testthat/test-register-s3.R | 4 +- tests/testthat/test-rowid-data.R | 4 +- tests/testthat/test-rowid-title.R | 4 +- tests/testthat/test-rowid-type.R | 4 +- tests/testthat/test-shaft-.R | 147 +++++++++++++++++++++- tests/testthat/test-shaft-simple.R | 4 +- tests/testthat/test-sigfig.R | 4 +- tests/testthat/test-styles.R | 13 +- tests/testthat/test-tbl-format-body.R | 18 +++ tests/testthat/test-tbl-format-footer.R | 18 +++ tests/testthat/test-tbl-format-header.R | 18 +++ tests/testthat/test-tbl-format-setup.R | 17 ++- tests/testthat/test-tbl-format.R | 8 +- tests/testthat/test-tbl-sum.R | 18 +++ tests/testthat/test-tbl.R | 4 +- tests/testthat/test-title.R | 4 +- tests/testthat/test-type-sum.R | 58 ++++++++- tests/testthat/test-type.R | 26 +++- tests/testthat/test-vctr.R | 41 +++--- tests/testthat/test-vctrs.R | 26 +++- tests/testthat/test-zzz.R | 4 +- 33 files changed, 635 insertions(+), 122 deletions(-) diff --git a/tests/testthat/test-capital.R b/tests/testthat/test-capital.R index 6a6960912..2731dd3a3 100644 --- a/tests/testthat/test-capital.R +++ b/tests/testthat/test-capital.R @@ -16,9 +16,9 @@ test_that("`new_pillar_capital()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar_capital --------------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_capital()` snapshot test", { expect_snapshot({ format() }) diff --git a/tests/testthat/test-char.R b/tests/testthat/test-char.R index da5156202..32245b2af 100644 --- a/tests/testthat/test-char.R +++ b/tests/testthat/test-char.R @@ -7,27 +7,27 @@ test_that("`char()` snapshot test", { }) -# vec_ptype_full ---------------------------------------------------------------------- +# vec_ptype_full.pillar_char ---------------------------------------------------------- -test_that("`vec_ptype_full()` snapshot test", { +test_that("`vec_ptype_full.pillar_char()` snapshot test", { expect_snapshot({ vec_ptype_full() }) }) -# vec_ptype_abbr ---------------------------------------------------------------------- +# vec_ptype_abbr.pillar_char ---------------------------------------------------------- -test_that("`vec_ptype_abbr()` snapshot test", { +test_that("`vec_ptype_abbr.pillar_char()` snapshot test", { expect_snapshot({ vec_ptype_abbr() }) }) -# format ------------------------------------------------------------------------------ +# format.pillar_char ------------------------------------------------------------------ -test_that("`format()` snapshot test", { +test_that("`format.pillar_char()` snapshot test", { expect_snapshot({ format() }) @@ -43,37 +43,64 @@ test_that("`set_char_opts()` snapshot test", { }) -# vec_ptype2.pillar_char -------------------------------------------------------------- +# format.pillar_char_attr ------------------------------------------------------------- -test_that("`vec_ptype2.pillar_char()` snapshot test", { +test_that("`format.pillar_char_attr()` snapshot test", { + expect_snapshot({ + format() + }) +}) + + +# vec_ptype2.pillar_char.pillar_char -------------------------------------------------- + +test_that("`vec_ptype2.pillar_char.pillar_char()` snapshot test", { expect_snapshot({ vec_ptype2.pillar_char() }) }) -# vec_ptype2.character ---------------------------------------------------------------- +# vec_ptype2.pillar_char.character ---------------------------------------------------- -test_that("`vec_ptype2.character()` snapshot test", { +test_that("`vec_ptype2.pillar_char.character()` snapshot test", { + expect_snapshot({ + vec_ptype2.pillar_char() + }) +}) + + +# vec_ptype2.character.pillar_char ---------------------------------------------------- + +test_that("`vec_ptype2.character.pillar_char()` snapshot test", { expect_snapshot({ vec_ptype2.character() }) }) -# vec_cast.pillar_char ---------------------------------------------------------------- +# vec_cast.pillar_char.pillar_char ---------------------------------------------------- -test_that("`vec_cast.pillar_char()` snapshot test", { +test_that("`vec_cast.pillar_char.pillar_char()` snapshot test", { expect_snapshot({ vec_cast.pillar_char() }) }) -# vec_cast.character ------------------------------------------------------------------ +# vec_cast.character.pillar_char ------------------------------------------------------ -test_that("`vec_cast.character()` snapshot test", { +test_that("`vec_cast.character.pillar_char()` snapshot test", { expect_snapshot({ vec_cast.character() }) }) + + +# vec_cast.pillar_char.character ------------------------------------------------------ + +test_that("`vec_cast.pillar_char.character()` snapshot test", { + expect_snapshot({ + vec_cast.pillar_char() + }) +}) diff --git a/tests/testthat/test-continuation-data.R b/tests/testthat/test-continuation-data.R index 2a4db1322..a94e6eddd 100644 --- a/tests/testthat/test-continuation-data.R +++ b/tests/testthat/test-continuation-data.R @@ -7,9 +7,9 @@ test_that("`new_continuation_shaft()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar_continuation_shaft ---------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_continuation_shaft()` snapshot test", { expect_snapshot({ format() }) diff --git a/tests/testthat/test-ctl_new_pillar.R b/tests/testthat/test-ctl_new_pillar.R index 8de0a8f2a..558409e96 100644 --- a/tests/testthat/test-ctl_new_pillar.R +++ b/tests/testthat/test-ctl_new_pillar.R @@ -7,6 +7,15 @@ test_that("`ctl_new_pillar()` snapshot test", { }) +# ctl_new_pillar.tbl ------------------------------------------------------------------ + +test_that("`ctl_new_pillar.tbl()` snapshot test", { + expect_snapshot({ + ctl_new_pillar() + }) +}) + + # ctl_new_rowid_pillar ---------------------------------------------------------------- test_that("`ctl_new_rowid_pillar()` snapshot test", { @@ -16,6 +25,15 @@ test_that("`ctl_new_rowid_pillar()` snapshot test", { }) +# ctl_new_rowid_pillar.tbl ------------------------------------------------------------ + +test_that("`ctl_new_rowid_pillar.tbl()` snapshot test", { + expect_snapshot({ + ctl_new_rowid_pillar() + }) +}) + + # max0 -------------------------------------------------------------------------------- test_that("`max0()` snapshot test", { diff --git a/tests/testthat/test-ctl_new_pillar_list.R b/tests/testthat/test-ctl_new_pillar_list.R index 1d90b7ef8..40087554e 100644 --- a/tests/testthat/test-ctl_new_pillar_list.R +++ b/tests/testthat/test-ctl_new_pillar_list.R @@ -7,6 +7,15 @@ test_that("`ctl_new_pillar_list()` snapshot test", { }) +# ctl_new_pillar_list.tbl ------------------------------------------------------------- + +test_that("`ctl_new_pillar_list.tbl()` snapshot test", { + expect_snapshot({ + ctl_new_pillar_list() + }) +}) + + # new_data_frame_pillar_list ---------------------------------------------------------- test_that("`new_data_frame_pillar_list()` snapshot test", { diff --git a/tests/testthat/test-ctl_pillar.R b/tests/testthat/test-ctl_pillar.R index c002b39e0..63bec0053 100644 --- a/tests/testthat/test-ctl_pillar.R +++ b/tests/testthat/test-ctl_pillar.R @@ -25,18 +25,18 @@ test_that("`new_pillar()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar ----------------------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar()` snapshot test", { expect_snapshot({ format() }) }) -# print ------------------------------------------------------------------------------- +# print.pillar ------------------------------------------------------------------------ -test_that("`print()` snapshot test", { +test_that("`print.pillar()` snapshot test", { expect_snapshot({ print() }) diff --git a/tests/testthat/test-ggplot2.R b/tests/testthat/test-ggplot2.R index 34b95b264..933542ef8 100644 --- a/tests/testthat/test-ggplot2.R +++ b/tests/testthat/test-ggplot2.R @@ -25,18 +25,18 @@ test_that("`MakeScaleContinuousPositionNum()` snapshot test", { }) -# scale_type -------------------------------------------------------------------------- +# scale_type.pillar_num --------------------------------------------------------------- -test_that("`scale_type()` snapshot test", { +test_that("`scale_type.pillar_num()` snapshot test", { expect_snapshot({ scale_type() }) }) -# rescale ----------------------------------------------------------------------------- +# rescale.pillar_num ------------------------------------------------------------------ -test_that("`rescale()` snapshot test", { +test_that("`rescale.pillar_num()` snapshot test", { expect_snapshot({ rescale() }) diff --git a/tests/testthat/test-glimpse.R b/tests/testthat/test-glimpse.R index 277836349..fb55499da 100644 --- a/tests/testthat/test-glimpse.R +++ b/tests/testthat/test-glimpse.R @@ -7,6 +7,24 @@ test_that("`glimpse()` snapshot test", { }) +# glimpse.tbl ------------------------------------------------------------------------- + +test_that("`glimpse.tbl()` snapshot test", { + expect_snapshot({ + glimpse() + }) +}) + + +# glimpse.default --------------------------------------------------------------------- + +test_that("`glimpse.default()` snapshot test", { + expect_snapshot({ + glimpse() + }) +}) + + # format_glimpse ---------------------------------------------------------------------- test_that("`format_glimpse()` snapshot test", { @@ -34,6 +52,42 @@ test_that("`format_glimpse_()` snapshot test", { }) +# format_glimpse.default -------------------------------------------------------------- + +test_that("`format_glimpse.default()` snapshot test", { + expect_snapshot({ + format_glimpse() + }) +}) + + +# format_glimpse.list ----------------------------------------------------------------- + +test_that("`format_glimpse.list()` snapshot test", { + expect_snapshot({ + format_glimpse() + }) +}) + + +# format_glimpse.character ------------------------------------------------------------ + +test_that("`format_glimpse.character()` snapshot test", { + expect_snapshot({ + format_glimpse() + }) +}) + + +# format_glimpse.factor --------------------------------------------------------------- + +test_that("`format_glimpse.factor()` snapshot test", { + expect_snapshot({ + format_glimpse() + }) +}) + + # Legacy tests ------------------------------------------------------------------------ test_that("format_glimpse() output test", { diff --git a/tests/testthat/test-multi.R b/tests/testthat/test-multi.R index 1cce4a704..3e25f3b07 100644 --- a/tests/testthat/test-multi.R +++ b/tests/testthat/test-multi.R @@ -97,27 +97,27 @@ test_that("`format_colonnade_tier()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar_squeezed_colonnade ---------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_squeezed_colonnade()` snapshot test", { expect_snapshot({ format() }) }) -# print ------------------------------------------------------------------------------- +# print.pillar_squeezed_colonnade ----------------------------------------------------- -test_that("`print()` snapshot test", { +test_that("`print.pillar_squeezed_colonnade()` snapshot test", { expect_snapshot({ print() }) }) -# knit_print -------------------------------------------------------------------------- +# knit_print.pillar_squeezed_colonnade ------------------------------------------------ -test_that("`knit_print()` snapshot test", { +test_that("`knit_print.pillar_squeezed_colonnade()` snapshot test", { expect_snapshot({ knit_print() }) @@ -142,6 +142,15 @@ test_that("`extra_cols()` snapshot test", { }) +# extra_cols.pillar_squeezed_colonnade ------------------------------------------------ + +test_that("`extra_cols.pillar_squeezed_colonnade()` snapshot test", { + expect_snapshot({ + extra_cols() + }) +}) + + # extra_cols_impl --------------------------------------------------------------------- test_that("`extra_cols_impl()` snapshot test", { @@ -151,6 +160,24 @@ test_that("`extra_cols_impl()` snapshot test", { }) +# format.pillar_colonnade ------------------------------------------------------------- + +test_that("`format.pillar_colonnade()` snapshot test", { + expect_snapshot({ + format() + }) +}) + + +# print.pillar_colonnade -------------------------------------------------------------- + +test_that("`print.pillar_colonnade()` snapshot test", { + expect_snapshot({ + print() + }) +}) + + # colonnade_get_width ----------------------------------------------------------------- test_that("`colonnade_get_width()` snapshot test", { diff --git a/tests/testthat/test-num.R b/tests/testthat/test-num.R index 647b85331..7cfd03dfa 100644 --- a/tests/testthat/test-num.R +++ b/tests/testthat/test-num.R @@ -7,54 +7,63 @@ test_that("`num()` snapshot test", { }) -# vec_ptype_full ---------------------------------------------------------------------- +# vec_ptype_full.pillar_num ----------------------------------------------------------- -test_that("`vec_ptype_full()` snapshot test", { +test_that("`vec_ptype_full.pillar_num()` snapshot test", { expect_snapshot({ vec_ptype_full() }) }) -# vec_ptype_abbr ---------------------------------------------------------------------- +# vec_ptype_abbr.pillar_num ----------------------------------------------------------- -test_that("`vec_ptype_abbr()` snapshot test", { +test_that("`vec_ptype_abbr.pillar_num()` snapshot test", { expect_snapshot({ vec_ptype_abbr() }) }) -# format ------------------------------------------------------------------------------ +# format.pillar_num ------------------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_num()` snapshot test", { expect_snapshot({ format() }) }) -# vec_arith --------------------------------------------------------------------------- +# vec_arith.pillar_num ---------------------------------------------------------------- -test_that("`vec_arith()` snapshot test", { +test_that("`vec_arith.pillar_num()` snapshot test", { expect_snapshot({ vec_arith() }) }) -# vec_arith.pillar_num ---------------------------------------------------------------- +# vec_arith.pillar_num.default -------------------------------------------------------- -test_that("`vec_arith.pillar_num()` snapshot test", { +test_that("`vec_arith.pillar_num.default()` snapshot test", { + expect_snapshot({ + vec_arith.pillar_num() + }) +}) + + +# vec_arith.pillar_num.MISSING -------------------------------------------------------- + +test_that("`vec_arith.pillar_num.MISSING()` snapshot test", { expect_snapshot({ vec_arith.pillar_num() }) }) -# vec_math ---------------------------------------------------------------------------- +# vec_math.pillar_num ----------------------------------------------------------------- -test_that("`vec_math()` snapshot test", { +test_that("`vec_math.pillar_num()` snapshot test", { expect_snapshot({ vec_math() }) @@ -70,51 +79,96 @@ test_that("`set_num_opts()` snapshot test", { }) -# vec_ptype2.pillar_num --------------------------------------------------------------- +# format.pillar_num_attr -------------------------------------------------------------- + +test_that("`format.pillar_num_attr()` snapshot test", { + expect_snapshot({ + format() + }) +}) + + +# vec_ptype2.pillar_num.pillar_num ---------------------------------------------------- + +test_that("`vec_ptype2.pillar_num.pillar_num()` snapshot test", { + expect_snapshot({ + vec_ptype2.pillar_num() + }) +}) + + +# vec_ptype2.pillar_num.double -------------------------------------------------------- -test_that("`vec_ptype2.pillar_num()` snapshot test", { +test_that("`vec_ptype2.pillar_num.double()` snapshot test", { expect_snapshot({ vec_ptype2.pillar_num() }) }) -# vec_ptype2.double ------------------------------------------------------------------- +# vec_ptype2.double.pillar_num -------------------------------------------------------- -test_that("`vec_ptype2.double()` snapshot test", { +test_that("`vec_ptype2.double.pillar_num()` snapshot test", { expect_snapshot({ vec_ptype2.double() }) }) -# vec_ptype2.integer ------------------------------------------------------------------ +# vec_ptype2.pillar_num.integer ------------------------------------------------------- + +test_that("`vec_ptype2.pillar_num.integer()` snapshot test", { + expect_snapshot({ + vec_ptype2.pillar_num() + }) +}) + + +# vec_ptype2.integer.pillar_num ------------------------------------------------------- -test_that("`vec_ptype2.integer()` snapshot test", { +test_that("`vec_ptype2.integer.pillar_num()` snapshot test", { expect_snapshot({ vec_ptype2.integer() }) }) -# vec_cast.pillar_num ----------------------------------------------------------------- +# vec_cast.pillar_num.pillar_num ------------------------------------------------------ -test_that("`vec_cast.pillar_num()` snapshot test", { +test_that("`vec_cast.pillar_num.pillar_num()` snapshot test", { expect_snapshot({ vec_cast.pillar_num() }) }) -# vec_cast.double --------------------------------------------------------------------- +# vec_cast.double.pillar_num ---------------------------------------------------------- -test_that("`vec_cast.double()` snapshot test", { +test_that("`vec_cast.double.pillar_num()` snapshot test", { expect_snapshot({ vec_cast.double() }) }) +# vec_cast.pillar_num.double ---------------------------------------------------------- + +test_that("`vec_cast.pillar_num.double()` snapshot test", { + expect_snapshot({ + vec_cast.pillar_num() + }) +}) + + +# vec_cast.pillar_num.integer --------------------------------------------------------- + +test_that("`vec_cast.pillar_num.integer()` snapshot test", { + expect_snapshot({ + vec_cast.pillar_num() + }) +}) + + # Legacy tests ------------------------------------------------------------------------ test_that("output test", { diff --git a/tests/testthat/test-ornament.R b/tests/testthat/test-ornament.R index 933380647..9cd921892 100644 --- a/tests/testthat/test-ornament.R +++ b/tests/testthat/test-ornament.R @@ -7,18 +7,18 @@ test_that("`new_ornament()` snapshot test", { }) -# print ------------------------------------------------------------------------------- +# print.pillar_ornament --------------------------------------------------------------- -test_that("`print()` snapshot test", { +test_that("`print.pillar_ornament()` snapshot test", { expect_snapshot({ print() }) }) -# format ------------------------------------------------------------------------------ +# format.pillar_ornament -------------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_ornament()` snapshot test", { expect_snapshot({ format() }) diff --git a/tests/testthat/test-pillar.R b/tests/testthat/test-pillar.R index 9a2a848eb..3e151795a 100644 --- a/tests/testthat/test-pillar.R +++ b/tests/testthat/test-pillar.R @@ -16,18 +16,18 @@ test_that("`new_pillar_1e()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar_1e -------------------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_1e()` snapshot test", { expect_snapshot({ format() }) }) -# print ------------------------------------------------------------------------------- +# print.pillar_1e --------------------------------------------------------------------- -test_that("`print()` snapshot test", { +test_that("`print.pillar_1e()` snapshot test", { expect_snapshot({ print() }) diff --git a/tests/testthat/test-register-s3.R b/tests/testthat/test-register-s3.R index 92fabccbc..b75cac753 100644 --- a/tests/testthat/test-register-s3.R +++ b/tests/testthat/test-register-s3.R @@ -7,9 +7,9 @@ test_that("`s3_register()` snapshot test", { }) -# ------------------------------------------------------------------------------------ +# .rlang_s3_register_compat ----------------------------------------------------------- -test_that("`()` snapshot test", { +test_that("`.rlang_s3_register_compat()` snapshot test", { expect_snapshot({ () }) diff --git a/tests/testthat/test-rowid-data.R b/tests/testthat/test-rowid-data.R index 723b6f725..d908df9f5 100644 --- a/tests/testthat/test-rowid-data.R +++ b/tests/testthat/test-rowid-data.R @@ -16,9 +16,9 @@ test_that("`rif_shaft()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar_rif_shaft ------------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_rif_shaft()` snapshot test", { expect_snapshot({ format() }) diff --git a/tests/testthat/test-rowid-title.R b/tests/testthat/test-rowid-title.R index 090039919..05b2d4c5b 100644 --- a/tests/testthat/test-rowid-title.R +++ b/tests/testthat/test-rowid-title.R @@ -7,9 +7,9 @@ test_that("`rif_title()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar_rif_title ------------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_rif_title()` snapshot test", { expect_snapshot({ format() }) diff --git a/tests/testthat/test-rowid-type.R b/tests/testthat/test-rowid-type.R index a6e322ba1..3ef118c80 100644 --- a/tests/testthat/test-rowid-type.R +++ b/tests/testthat/test-rowid-type.R @@ -16,9 +16,9 @@ test_that("`rif_type()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar_rif_type -------------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_rif_type()` snapshot test", { expect_snapshot({ format() }) diff --git a/tests/testthat/test-shaft-.R b/tests/testthat/test-shaft-.R index 8de26dbb7..63ace3168 100644 --- a/tests/testthat/test-shaft-.R +++ b/tests/testthat/test-shaft-.R @@ -16,24 +16,51 @@ test_that("`pillar_shaft()` snapshot test", { }) -# print ------------------------------------------------------------------------------- +# pillar_shaft.pillar_empty_col ------------------------------------------------------- -test_that("`print()` snapshot test", { +test_that("`pillar_shaft.pillar_empty_col()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# print.pillar_shaft ------------------------------------------------------------------ + +test_that("`print.pillar_shaft()` snapshot test", { expect_snapshot({ print() }) }) -# format ------------------------------------------------------------------------------ +# format.pillar_shaft ----------------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_shaft()` snapshot test", { expect_snapshot({ format() }) }) +# pillar_shaft.logical ---------------------------------------------------------------- + +test_that("`pillar_shaft.logical()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# pillar_shaft.numeric ---------------------------------------------------------------- + +test_that("`pillar_shaft.numeric()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + # pillar_shaft_number_attr ------------------------------------------------------------ test_that("`pillar_shaft_number_attr()` snapshot test", { @@ -52,15 +79,123 @@ test_that("`pillar_shaft_number()` snapshot test", { }) -# type_sum ---------------------------------------------------------------------------- +# pillar_shaft.integer64 -------------------------------------------------------------- -test_that("`type_sum()` snapshot test", { +test_that("`pillar_shaft.integer64()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# pillar_shaft.Surv ------------------------------------------------------------------- + +test_that("`pillar_shaft.Surv()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# pillar_shaft.Surv2 ------------------------------------------------------------------ + +test_that("`pillar_shaft.Surv2()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# type_sum.Surv ----------------------------------------------------------------------- + +test_that("`type_sum.Surv()` snapshot test", { expect_snapshot({ type_sum() }) }) +# type_sum.Surv2 ---------------------------------------------------------------------- + +test_that("`type_sum.Surv2()` snapshot test", { + expect_snapshot({ + type_sum() + }) +}) + + +# pillar_shaft.Date ------------------------------------------------------------------- + +test_that("`pillar_shaft.Date()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# pillar_shaft.POSIXt ----------------------------------------------------------------- + +test_that("`pillar_shaft.POSIXt()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# pillar_shaft.character -------------------------------------------------------------- + +test_that("`pillar_shaft.character()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# pillar_shaft.glue ------------------------------------------------------------------- + +test_that("`pillar_shaft.glue()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# pillar_shaft.list ------------------------------------------------------------------- + +test_that("`pillar_shaft.list()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# pillar_shaft.factor ----------------------------------------------------------------- + +test_that("`pillar_shaft.factor()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# pillar_shaft.AsIs ------------------------------------------------------------------- + +test_that("`pillar_shaft.AsIs()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# pillar_shaft.default ---------------------------------------------------------------- + +test_that("`pillar_shaft.default()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + # Legacy tests ------------------------------------------------------------------------ test_that("S4 character class (tidyverse/tibble#1367)", { diff --git a/tests/testthat/test-shaft-simple.R b/tests/testthat/test-shaft-simple.R index c6c3ab21e..c4bfe7b1c 100644 --- a/tests/testthat/test-shaft-simple.R +++ b/tests/testthat/test-shaft-simple.R @@ -7,9 +7,9 @@ test_that("`new_pillar_shaft_simple()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar_shaft_simple ---------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_shaft_simple()` snapshot test", { expect_snapshot({ format() }) diff --git a/tests/testthat/test-sigfig.R b/tests/testthat/test-sigfig.R index 49b123e96..fc4220536 100644 --- a/tests/testthat/test-sigfig.R +++ b/tests/testthat/test-sigfig.R @@ -169,9 +169,9 @@ test_that("`assemble_decimal()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar_shaft_decimal --------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_shaft_decimal()` snapshot test", { expect_snapshot({ format() }) diff --git a/tests/testthat/test-styles.R b/tests/testthat/test-styles.R index 7ef3040cf..6116903e8 100644 --- a/tests/testthat/test-styles.R +++ b/tests/testthat/test-styles.R @@ -115,9 +115,18 @@ test_that("`crayon_bold()` snapshot test", { }) -# crayon_grey_0 ----------------------------------------------------------------------- +# crayon_grey_0.6 --------------------------------------------------------------------- -test_that("`crayon_grey_0()` snapshot test", { +test_that("`crayon_grey_0.6()` snapshot test", { + expect_snapshot({ + crayon_grey_0() + }) +}) + + +# crayon_grey_0.8 --------------------------------------------------------------------- + +test_that("`crayon_grey_0.8()` snapshot test", { expect_snapshot({ crayon_grey_0() }) diff --git a/tests/testthat/test-tbl-format-body.R b/tests/testthat/test-tbl-format-body.R index 7833f55df..242b86622 100644 --- a/tests/testthat/test-tbl-format-body.R +++ b/tests/testthat/test-tbl-format-body.R @@ -7,6 +7,24 @@ test_that("`tbl_format_body()` snapshot test", { }) +# tbl_format_body.tbl ----------------------------------------------------------------- + +test_that("`tbl_format_body.tbl()` snapshot test", { + expect_snapshot({ + tbl_format_body() + }) +}) + + +# tbl_format_body.pillar_tbl_format_setup --------------------------------------------- + +test_that("`tbl_format_body.pillar_tbl_format_setup()` snapshot test", { + expect_snapshot({ + tbl_format_body() + }) +}) + + # Legacy tests ------------------------------------------------------------------------ test_that("tbl_format_body() results", { diff --git a/tests/testthat/test-tbl-format-footer.R b/tests/testthat/test-tbl-format-footer.R index b94feaadc..4ac32295e 100644 --- a/tests/testthat/test-tbl-format-footer.R +++ b/tests/testthat/test-tbl-format-footer.R @@ -7,6 +7,24 @@ test_that("`tbl_format_footer()` snapshot test", { }) +# tbl_format_footer.pillar_tbl_format_setup ------------------------------------------- + +test_that("`tbl_format_footer.pillar_tbl_format_setup()` snapshot test", { + expect_snapshot({ + tbl_format_footer() + }) +}) + + +# tbl_format_footer.tbl --------------------------------------------------------------- + +test_that("`tbl_format_footer.tbl()` snapshot test", { + expect_snapshot({ + tbl_format_footer() + }) +}) + + # format_footer ----------------------------------------------------------------------- test_that("`format_footer()` snapshot test", { diff --git a/tests/testthat/test-tbl-format-header.R b/tests/testthat/test-tbl-format-header.R index 78e6c0796..13bb83322 100644 --- a/tests/testthat/test-tbl-format-header.R +++ b/tests/testthat/test-tbl-format-header.R @@ -7,6 +7,24 @@ test_that("`tbl_format_header()` snapshot test", { }) +# tbl_format_header.tbl --------------------------------------------------------------- + +test_that("`tbl_format_header.tbl()` snapshot test", { + expect_snapshot({ + tbl_format_header() + }) +}) + + +# tbl_format_header.pillar_tbl_format_setup ------------------------------------------- + +test_that("`tbl_format_header.pillar_tbl_format_setup()` snapshot test", { + expect_snapshot({ + tbl_format_header() + }) +}) + + # Legacy tests ------------------------------------------------------------------------ test_that("tbl_format_header() results", { diff --git a/tests/testthat/test-tbl-format-setup.R b/tests/testthat/test-tbl-format-setup.R index 737f30d6c..ba68cb8c2 100644 --- a/tests/testthat/test-tbl-format-setup.R +++ b/tests/testthat/test-tbl-format-setup.R @@ -16,6 +16,15 @@ test_that("`tbl_format_setup_dispatch()` snapshot test", { }) +# tbl_format_setup.tbl ---------------------------------------------------------------- + +test_that("`tbl_format_setup.tbl()` snapshot test", { + expect_snapshot({ + tbl_format_setup() + }) +}) + + # new_tbl_format_setup ---------------------------------------------------------------- test_that("`new_tbl_format_setup()` snapshot test", { @@ -34,18 +43,18 @@ test_that("`is_tbl_format_setup()` snapshot test", { }) -# print ------------------------------------------------------------------------------- +# print.pillar_tbl_format_setup ------------------------------------------------------- -test_that("`print()` snapshot test", { +test_that("`print.pillar_tbl_format_setup()` snapshot test", { expect_snapshot({ print() }) }) -# format ------------------------------------------------------------------------------ +# format.pillar_tbl_format_setup ------------------------------------------------------ -test_that("`format()` snapshot test", { +test_that("`format.pillar_tbl_format_setup()` snapshot test", { expect_snapshot({ format() }) diff --git a/tests/testthat/test-tbl-format.R b/tests/testthat/test-tbl-format.R index 084628f17..748dea807 100644 --- a/tests/testthat/test-tbl-format.R +++ b/tests/testthat/test-tbl-format.R @@ -1,6 +1,6 @@ -# print ------------------------------------------------------------------------------- +# print.tbl --------------------------------------------------------------------------- -test_that("`print()` snapshot test", { +test_that("`print.tbl()` snapshot test", { expect_snapshot({ print() }) @@ -16,9 +16,9 @@ test_that("`print_tbl()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.tbl -------------------------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.tbl()` snapshot test", { expect_snapshot({ format() }) diff --git a/tests/testthat/test-tbl-sum.R b/tests/testthat/test-tbl-sum.R index 3aaae9555..e107b5ffa 100644 --- a/tests/testthat/test-tbl-sum.R +++ b/tests/testthat/test-tbl-sum.R @@ -5,3 +5,21 @@ test_that("`tbl_sum()` snapshot test", { tbl_sum() }) }) + + +# tbl_sum.default --------------------------------------------------------------------- + +test_that("`tbl_sum.default()` snapshot test", { + expect_snapshot({ + tbl_sum() + }) +}) + + +# tbl_sum.tbl ------------------------------------------------------------------------- + +test_that("`tbl_sum.tbl()` snapshot test", { + expect_snapshot({ + tbl_sum() + }) +}) diff --git a/tests/testthat/test-tbl.R b/tests/testthat/test-tbl.R index 587fc6ec6..e7ba5f7e5 100644 --- a/tests/testthat/test-tbl.R +++ b/tests/testthat/test-tbl.R @@ -16,9 +16,9 @@ test_that("`as_tbl()` snapshot test", { }) -# as_tbl.data ------------------------------------------------------------------------- +# as_tbl.data.frame ------------------------------------------------------------------- -test_that("`as_tbl.data()` snapshot test", { +test_that("`as_tbl.data.frame()` snapshot test", { expect_snapshot({ as_tbl.data() }) diff --git a/tests/testthat/test-title.R b/tests/testthat/test-title.R index a630f4fcc..04bc9d9c7 100644 --- a/tests/testthat/test-title.R +++ b/tests/testthat/test-title.R @@ -16,9 +16,9 @@ test_that("`get_min_title_width()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar_title ----------------------------------------------------------------- -test_that("`format()` snapshot test", { +test_that("`format.pillar_title()` snapshot test", { expect_snapshot({ format() }) diff --git a/tests/testthat/test-type-sum.R b/tests/testthat/test-type-sum.R index b0cf67dda..bae9ddb81 100644 --- a/tests/testthat/test-type-sum.R +++ b/tests/testthat/test-type-sum.R @@ -7,9 +7,36 @@ test_that("`type_sum()` snapshot test", { }) -# vec_ptype_abbr ---------------------------------------------------------------------- +# type_sum.ordered -------------------------------------------------------------------- -test_that("`vec_ptype_abbr()` snapshot test", { +test_that("`type_sum.ordered()` snapshot test", { + expect_snapshot({ + type_sum() + }) +}) + + +# type_sum.factor --------------------------------------------------------------------- + +test_that("`type_sum.factor()` snapshot test", { + expect_snapshot({ + type_sum() + }) +}) + + +# type_sum.default -------------------------------------------------------------------- + +test_that("`type_sum.default()` snapshot test", { + expect_snapshot({ + type_sum() + }) +}) + + +# vec_ptype_abbr.pillar_empty_col ----------------------------------------------------- + +test_that("`vec_ptype_abbr.pillar_empty_col()` snapshot test", { expect_snapshot({ vec_ptype_abbr() }) @@ -25,6 +52,24 @@ test_that("`obj_sum()` snapshot test", { }) +# obj_sum.default --------------------------------------------------------------------- + +test_that("`obj_sum.default()` snapshot test", { + expect_snapshot({ + obj_sum() + }) +}) + + +# obj_sum.AsIs ------------------------------------------------------------------------ + +test_that("`obj_sum.AsIs()` snapshot test", { + expect_snapshot({ + obj_sum() + }) +}) + + # size_sum ---------------------------------------------------------------------------- test_that("`size_sum()` snapshot test", { @@ -32,3 +77,12 @@ test_that("`size_sum()` snapshot test", { size_sum() }) }) + + +# size_sum.default -------------------------------------------------------------------- + +test_that("`size_sum.default()` snapshot test", { + expect_snapshot({ + size_sum() + }) +}) diff --git a/tests/testthat/test-type.R b/tests/testthat/test-type.R index 784a6ba20..e81ae4eec 100644 --- a/tests/testthat/test-type.R +++ b/tests/testthat/test-type.R @@ -34,9 +34,9 @@ test_that("`get_pillar_type()` snapshot test", { }) -# format ------------------------------------------------------------------------------ +# format.pillar_type ------------------------------------------------------------------ -test_that("`format()` snapshot test", { +test_that("`format.pillar_type()` snapshot test", { expect_snapshot({ format() }) @@ -61,10 +61,28 @@ test_that("`format_type_sum()` snapshot test", { }) -# type_sum ---------------------------------------------------------------------------- +# type_sum.accel ---------------------------------------------------------------------- -test_that("`type_sum()` snapshot test", { +test_that("`type_sum.accel()` snapshot test", { expect_snapshot({ type_sum() }) }) + + +# format_type_sum.default ------------------------------------------------------------- + +test_that("`format_type_sum.default()` snapshot test", { + expect_snapshot({ + format_type_sum() + }) +}) + + +# format_type_sum.AsIs ---------------------------------------------------------------- + +test_that("`format_type_sum.AsIs()` snapshot test", { + expect_snapshot({ + format_type_sum() + }) +}) diff --git a/tests/testthat/test-vctr.R b/tests/testthat/test-vctr.R index 845294879..fcd8212f8 100644 --- a/tests/testthat/test-vctr.R +++ b/tests/testthat/test-vctr.R @@ -1,69 +1,78 @@ -# pillar_shaft ------------------------------------------------------------------------ +# pillar_shaft.pillar_vctr ------------------------------------------------------------ -test_that("`pillar_shaft()` snapshot test", { +test_that("`pillar_shaft.pillar_vctr()` snapshot test", { expect_snapshot({ pillar_shaft() }) }) -# vec_ptype_full ---------------------------------------------------------------------- +# vec_ptype_full.pillar_vctr ---------------------------------------------------------- -test_that("`vec_ptype_full()` snapshot test", { +test_that("`vec_ptype_full.pillar_vctr()` snapshot test", { expect_snapshot({ vec_ptype_full() }) }) -# print ------------------------------------------------------------------------------- +# print.pillar_vctr ------------------------------------------------------------------- -test_that("`print()` snapshot test", { +test_that("`print.pillar_vctr()` snapshot test", { expect_snapshot({ print() }) }) -# obj_print_header -------------------------------------------------------------------- +# obj_print_header.pillar_vctr -------------------------------------------------------- -test_that("`obj_print_header()` snapshot test", { +test_that("`obj_print_header.pillar_vctr()` snapshot test", { expect_snapshot({ obj_print_header() }) }) -# obj_print_data ---------------------------------------------------------------------- +# obj_print_data.pillar_vctr ---------------------------------------------------------- -test_that("`obj_print_data()` snapshot test", { +test_that("`obj_print_data.pillar_vctr()` snapshot test", { expect_snapshot({ obj_print_data() }) }) -# obj_print_footer -------------------------------------------------------------------- +# obj_print_footer.pillar_vctr -------------------------------------------------------- -test_that("`obj_print_footer()` snapshot test", { +test_that("`obj_print_footer.pillar_vctr()` snapshot test", { expect_snapshot({ obj_print_footer() }) }) -# vec_proxy_compare ------------------------------------------------------------------- +# print.pillar_vctr_attr -------------------------------------------------------------- -test_that("`vec_proxy_compare()` snapshot test", { +test_that("`print.pillar_vctr_attr()` snapshot test", { + expect_snapshot({ + print() + }) +}) + + +# vec_proxy_compare.pillar_vctr ------------------------------------------------------- + +test_that("`vec_proxy_compare.pillar_vctr()` snapshot test", { expect_snapshot({ vec_proxy_compare() }) }) -# vec_proxy_order --------------------------------------------------------------------- +# vec_proxy_order.pillar_vctr --------------------------------------------------------- -test_that("`vec_proxy_order()` snapshot test", { +test_that("`vec_proxy_order.pillar_vctr()` snapshot test", { expect_snapshot({ vec_proxy_order() }) diff --git a/tests/testthat/test-vctrs.R b/tests/testthat/test-vctrs.R index 1ff32bbcf..e63d6b3b6 100644 --- a/tests/testthat/test-vctrs.R +++ b/tests/testthat/test-vctrs.R @@ -1,16 +1,34 @@ -# pillar_shaft ------------------------------------------------------------------------ +# pillar_shaft.vctrs_unspecified ------------------------------------------------------ -test_that("`pillar_shaft()` snapshot test", { +test_that("`pillar_shaft.vctrs_unspecified()` snapshot test", { expect_snapshot({ pillar_shaft() }) }) -# type_sum ---------------------------------------------------------------------------- +# pillar_shaft.vctrs_vctr ------------------------------------------------------------- -test_that("`type_sum()` snapshot test", { +test_that("`pillar_shaft.vctrs_vctr()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) + + +# type_sum.vctrs_vctr ----------------------------------------------------------------- + +test_that("`type_sum.vctrs_vctr()` snapshot test", { expect_snapshot({ type_sum() }) }) + + +# pillar_shaft.vctrs_list_of ---------------------------------------------------------- + +test_that("`pillar_shaft.vctrs_list_of()` snapshot test", { + expect_snapshot({ + pillar_shaft() + }) +}) diff --git a/tests/testthat/test-zzz.R b/tests/testthat/test-zzz.R index 8bbbf4e3c..5b431435c 100644 --- a/tests/testthat/test-zzz.R +++ b/tests/testthat/test-zzz.R @@ -1,6 +1,6 @@ -# ------------------------------------------------------------------------------------ +# .onLoad ----------------------------------------------------------------------------- -test_that("`()` snapshot test", { +test_that("`.onLoad()` snapshot test", { expect_snapshot({ () })