tests/testthat/test-shared-formula.R

context("Shared formulas")

test_that("Shared formulas are propogated correctly", {
  formulas <- tidyxl::xlsx_cells("./examples.xlsx")$formula
  expect_equal(formulas[41], "$A$18+1")
  expect_equal(formulas[42], "A20+2")
  expect_equal(formulas[195], "C3&\"C1\"\"\"")
  expect_equal(formulas[199], "LOG12")
  expect_equal(formulas[203], "LOG10(1)")
  expect_equal(formulas[235], "A1A")
  expect_equal(formulas[239], "E09904.2!A3")
  formulas <- tidyxl::xlsx_cells("./formulas.xlsx")$formula
  expect_equal(formulas[3], "N($A2)")
  expect_equal(formulas[12], "G4*H4")
})

Try the tidyxl package in your browser

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

tidyxl documentation built on Nov. 2, 2023, 5:11 p.m.