Skip to content

Commit

Permalink
Tweak test
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVaughan committed Aug 28, 2024
1 parent 03f399b commit 0dec1b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions tests/testthat/_snaps/chop.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
Error in `chop()`:
! `cols` is absent but must be supplied.

# incompatible ptype mentions the column
# incompatible ptype mentions the column (#1477)

Code
(expect_error(unnest(df, data, ptype = list(data = integer()))))
Output
<error/vctrs_error_cast>
unnest(df, data, ptype = list(data = integer()))
Condition
Error in `unnest()`:
! Can't convert `data[[2]]` <character> to <integer>.

Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-chop.R
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ test_that("`ptype = list()` uses list ptype", {
)
})

test_that("incompatible ptype mentions the column", {
test_that("incompatible ptype mentions the column (#1477)", {
df <- tibble(data = list(1, "2"))

expect_snapshot(
(expect_error(unnest(df, data, ptype = list(data = integer()))))
)
expect_snapshot(error = TRUE, {
unnest(df, data, ptype = list(data = integer()))
})
})

test_that("unchopping a bare empty list results in unspecified()", {
Expand Down

0 comments on commit 0dec1b0

Please sign in to comment.