context("Check Cell Ref")

test_that("Provide tests for single getCellRefs", {
  expect_equal(getCellRefs(data.frame(1, 2)), "B1")

  expect_error(getCellRefs(c(1, 2)))

  expect_error(getCellRefs(c(1, "a")))

test_that("Provide tests for multiple getCellRefs", {
  expect_equal(getCellRefs(data.frame(1:3, 2:4)), c("B1", "C2", "D3"))

  expect_error(getCellRefs(c(1:2, c("a", "b"))))

Try the openxlsx package in your browser

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

openxlsx documentation built on Feb. 16, 2023, 6:47 p.m.