tests/testthat/test-names.R

context("xlsx_names()")

library(tibble)

test_that("xlsx_names() doesn't fail when there aren't any names", {
  expect_error(xlsx_names("./default.xlsx"), NA)
})

test_that("xlsx_names() refers to the correct sheet names", {
  expect_equal(tidyxl::xlsx_names("./examples.xlsx")$sheet[2], "E09904.2")
})

test_that("xlsx_names() determines correctly whether a name is a range", {
  expect_equal(tidyxl::xlsx_names("./examples.xlsx")$is_range[1:5],
               c(FALSE, TRUE, TRUE, FALSE, TRUE))
})

Try the tidyxl package in your browser

Any scripts or data that you put into this service are public.

tidyxl documentation built on May 29, 2024, 2:34 a.m.