Skip to content

Commit

Permalink
More explicit test
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Feb 23, 2024
1 parent b2be34d commit de3dd41
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/testthat/test_read.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,18 @@ test_that("duckdb_read_csv() works as expected", {
# test better na.strings handling
# see https://github.com/duckdb/duckdb/issues/8590
tf3 <- tempfile()
na_strings <- data.frame(num=c(0.5, 2, NA), char=c('yes', 'no', NA), logi=c(TRUE, FALSE, NA), lisst=c(list(1), list(2, 3), NA))
write.csv(na_strings, tf3, row.names = FALSE)
csv <- c(
'"num","char","logi","lisst.1","lisst.2","lisst.3","lisst.NA"',
'0.5,"yes",TRUE,1,2,3,NA',
'2,"no",FALSE,1,2,3,NA',
'NA,NA,NA,1,2,3,NA'
)
writeLines(csv, tf3)
duckdb_read_csv(con, "na_table", tf3, na.strings = "-")
expect_identical(
dbReadTable(con, "na_table"),
read.csv(tf3, na.strings = "-")
)

dbDisconnect(con, shutdown = TRUE)
})
})

0 comments on commit de3dd41

Please sign in to comment.