tests/testthat/test-delete_na.R

test_that("example works as specified", {
  y <- list(c(1:3), NA, c(1, NA), list(c(5:6, NA), NA, "A"))
  tmp1 <- delete_na(y, recursive = FALSE)
  res1 <- list(c(1:3), c(1, NA), list(c(5:6, NA), NA, "A"))
  expect_equal(tmp1, res1)

  tmp2 <- delete_na(y, recursive = TRUE)
  res2 <- list(c(1:3), c(1), list(c(5:6), "A"))
  expect_equal(tmp2, res2)
})
stat545ubc-2021/functions-Jiangsissi720 documentation built on Dec. 23, 2021, 5:25 a.m.