Skip to content

Commit

Permalink
add test to exercise the col_guess()->resolve_collectors() code path
Browse files Browse the repository at this point in the history
  • Loading branch information
khusmann committed Jul 18, 2024
1 parent ca143b4 commit 255cabd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testthat/test-col-na.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,20 @@ test_that("collector-level na overrides global na", {
)
)
})

test_that("collector-level na works with col_guess", {
test_vroom(
"a,b,c\n1,1.1,REFUSED\n2,REFUSED,NA\nOMITTED,2.2,OMITTED\n",
col_types = cols(
a = col_guess(na = "OMITTED"),
b = col_guess(na = "REFUSED"),
c = col_guess(),
),
na = "NA",
equals = tibble::tibble(
a = c(1, 2, NA),
b = c(1.1, NA, 2.2),
c = c("REFUSED", NA, "OMITTED"),
)
)
})

0 comments on commit 255cabd

Please sign in to comment.