Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 29, 2023
1 parent 5d20f0e commit 15844a9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/testthat/test-empty-dataframe.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,16 @@ test_that("empty_columns with only NA characters", {
)
expect_identical(empty_columns(tmp), c(var2 = 2L))
})


test_that("works with non-ascii chars", {
tmp <- data.frame(
a = c(1, 2, 3, NA, 5),
b = c("", NA, "", NA, ""),
c = c(NA, NA, NA, NA, NA),
d = c("test", "Se\x96ora", "works fine", "this too", "yeah"),
e = c("", "", "", "", ""),
stringsAsFactors = FALSE
)
expect_identical(empty_columns(tmp), c(b = 2L, c = 3L, e = 5L))
})

0 comments on commit 15844a9

Please sign in to comment.