Skip to content

Commit

Permalink
Update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Oct 7, 2023
1 parent b3d0912 commit 713d9e6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/edition-1/col-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Code
out <- read_csv(readr_example("mtcars.csv"))
Message <readr_spec_message>
Message
-- Column specification --------------------------------------------------------
cols(
Expand All @@ -23,7 +23,7 @@

Code
out <- read_csv(readr_example("mtcars.csv"), show_col_types = TRUE)
Message <readr_spec_message>
Message
-- Column specification --------------------------------------------------------
cols(
Expand Down
19 changes: 11 additions & 8 deletions tests/testthat/_snaps/edition-1/read-csv.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,47 @@

Code
out3 <- read_csv(I("v1,v2\n\n1,2\n\n3,4"), col_types = "i")
Warning <simpleWarning>
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 <simpleWarning>
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 <simpleWarning>
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 <simpleWarning>
Condition
Warning:
1 parsing failure.
row col expected actual file
1 -- 2 columns 1 columns literal data

6 changes: 2 additions & 4 deletions tests/testthat/_snaps/edition-2/col-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

Code
out <- read_csv(readr_example("mtcars.csv"))
Message <vroom_dim_message>
Message
Rows: 32 Columns: 11
Message <vroom_spec_message>
-- Column specification --------------------------------------------------------
Delimiter: ","
dbl (11): mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb
Expand All @@ -16,9 +15,8 @@

Code
out <- read_csv(readr_example("mtcars.csv"), show_col_types = TRUE)
Message <vroom_dim_message>
Message
Rows: 32 Columns: 11
Message <vroom_spec_message>
-- Column specification --------------------------------------------------------
Delimiter: ","
dbl (11): mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb
Expand Down
10 changes: 6 additions & 4 deletions tests/testthat/_snaps/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
Code
name <- 1
check_string(name)
Error <simpleError>
`name` must be a string.
Condition
Error:
! `name` must be a string.
Code
check_string(name, nm = "NAME!")
Error <simpleError>
`NAME!` must be a string.
Condition
Error:
! `NAME!` must be a string.

0 comments on commit 713d9e6

Please sign in to comment.