tests/testthat/test-read_xlsx_random_seed.R

test_that("read_xlsx() does not change random seed", {
  rs <- .Random.seed
  expect_identical(rs, .Random.seed)
  tf <- temp_xlsx()
  expect_identical(rs, .Random.seed)
  write.xlsx(data.frame(a = 1), tf)
  expect_identical(rs, .Random.seed)
  read.xlsx(tf)
  expect_identical(rs, .Random.seed)
  unlink(tf)
})

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.