From 713d9e6ffac03784aead9ab643fd912afe0e2966 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Sat, 7 Oct 2023 14:07:55 -0700 Subject: [PATCH] Update snapshots --- tests/testthat/_snaps/edition-1/col-spec.md | 4 ++-- tests/testthat/_snaps/edition-1/read-csv.md | 19 +++++++++++-------- tests/testthat/_snaps/edition-2/col-spec.md | 6 ++---- tests/testthat/_snaps/utils.md | 10 ++++++---- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/tests/testthat/_snaps/edition-1/col-spec.md b/tests/testthat/_snaps/edition-1/col-spec.md index ddd87a40..1a8edc2b 100644 --- a/tests/testthat/_snaps/edition-1/col-spec.md +++ b/tests/testthat/_snaps/edition-1/col-spec.md @@ -2,7 +2,7 @@ Code out <- read_csv(readr_example("mtcars.csv")) - Message + Message -- Column specification -------------------------------------------------------- cols( @@ -23,7 +23,7 @@ Code out <- read_csv(readr_example("mtcars.csv"), show_col_types = TRUE) - Message + Message -- Column specification -------------------------------------------------------- cols( diff --git a/tests/testthat/_snaps/edition-1/read-csv.md b/tests/testthat/_snaps/edition-1/read-csv.md index 1f031791..fddbcc0a 100644 --- a/tests/testthat/_snaps/edition-1/read-csv.md +++ b/tests/testthat/_snaps/edition-1/read-csv.md @@ -2,44 +2,47 @@ Code out3 <- read_csv(I("v1,v2\n\n1,2\n\n3,4"), col_types = "i") - Warning + Condition + Warning: Unnamed `col_types` should have the same length as `col_names`. Using smaller of the two. + Warning: 2 parsing failures. row col expected actual file 1 -- 1 columns 2 columns literal data 2 -- 1 columns 2 columns literal data - --- Code out4 <- read_csv(I("v1,v2\n#foo\n1,2\n#bar\n3,4"), col_types = "i", comment = "#") - Warning + Condition + Warning: Unnamed `col_types` should have the same length as `col_names`. Using smaller of the two. + Warning: 2 parsing failures. row col expected actual file 1 -- 1 columns 2 columns literal data 2 -- 1 columns 2 columns literal data - # too few or extra col_types generates warnings Code out1 <- read_csv(I("v1,v2\n1,2"), col_types = "i", lazy = FALSE) - Warning + Condition + Warning: Unnamed `col_types` should have the same length as `col_names`. Using smaller of the two. + Warning: 1 parsing failure. row col expected actual file 1 -- 1 columns 2 columns literal data - # comments are ignored regardless of where they appear Code out4 <- read_csv(I("x,y\n1,#comment"), comment = "#", col_types = "cc") - Warning + Condition + Warning: 1 parsing failure. row col expected actual file 1 -- 2 columns 1 columns literal data - diff --git a/tests/testthat/_snaps/edition-2/col-spec.md b/tests/testthat/_snaps/edition-2/col-spec.md index 3051c817..17e94115 100644 --- a/tests/testthat/_snaps/edition-2/col-spec.md +++ b/tests/testthat/_snaps/edition-2/col-spec.md @@ -2,9 +2,8 @@ Code out <- read_csv(readr_example("mtcars.csv")) - Message + Message Rows: 32 Columns: 11 - Message -- Column specification -------------------------------------------------------- Delimiter: "," dbl (11): mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb @@ -16,9 +15,8 @@ Code out <- read_csv(readr_example("mtcars.csv"), show_col_types = TRUE) - Message + Message Rows: 32 Columns: 11 - Message -- Column specification -------------------------------------------------------- Delimiter: "," dbl (11): mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb diff --git a/tests/testthat/_snaps/utils.md b/tests/testthat/_snaps/utils.md index f098180b..ca38a7d8 100644 --- a/tests/testthat/_snaps/utils.md +++ b/tests/testthat/_snaps/utils.md @@ -3,10 +3,12 @@ Code name <- 1 check_string(name) - Error - `name` must be a string. + Condition + Error: + ! `name` must be a string. Code check_string(name, nm = "NAME!") - Error - `NAME!` must be a string. + Condition + Error: + ! `NAME!` must be a string.