Skip to content
Prev 3616 / 12125 Next

[R-pkg-devel] How to debug CRAN errors?

The complaint
-- 1. Failure: Data written in appropriate format
(@test-openxlsx.R#101) ------
     `openxlsx::saveWorkbook(wb, file = "test-xlsx.xlsx", overwrite =
TRUE)` produced messages.

comes from your call to testthat::expect_silent()

test_that("Data written in appropriate format", {
  hx <- huxtable(a = 1:2 + 0.5, b = -1:-2 + 0.5, d = letters[1:2],
add_colnames = TRUE)
  wb <- as_Workbook(hx)
  expect_silent(openxlsx::saveWorkbook(wb, file = "test-xlsx.xlsx",
overwrite = TRUE))


Perhaps you should suggest to the authors of testthat that it would be nice
if expect_silent() showed some of the text of the messages, etc., instead
of just saying that messages were produced.

By the way, I think your test test should write to a file in [a
subdirectory of]] tempdir(), not to a file in the current directory.

comes from
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Wed, Mar 13, 2019 at 8:50 AM David Hugh-Jones <davidhughjones at gmail.com>
wrote: