[R-pkg-devel] Another CRAN-only bug
That is true. But the test doesn?t fail on my machine, or several others, so I still wonder how I am going to debug it.
On Thu, 13 Jun 2019 at 10:54, I?aki Ucar <iucar at fedoraproject.org> wrote:
On Thu, 13 Jun 2019 at 10:41, David Hugh-Jones <davidhughjones at gmail.com> wrote:
Well, the test that fails is this one:
The last line fails here:
hx <- huxtable(a = 1:2 + 0.5, b = -1:-2 + 0.5, d = letters[1:2],
add_colnames = TRUE)
wb <- as_Workbook(hx)
expect_error(openxlsx::saveWorkbook(wb, file = "test-xlsx.xlsx",
overwrite = TRUE),
regexp = NA) # openxlsx may emit messages
dfr <- openxlsx::read.xlsx("test-xlsx.xlsx")
expect_equivalent(class(dfr[[1]]), "numeric")
expect_equivalent(class(dfr[[2]]), "numeric")
expect_equivalent(class(dfr[[3]]), "character")
expect_equal(dfr[[1]], 1:2 + 0.5)
Putting to one side the issue of testthat?s putative faults, I am happy
to
debug this myself, but how can I reproduce the platform to do it on?
According to the errors, -- 1. Failure: Data written in appropriate format (@test-openxlsx.R#107) ------ dfr[[1]] not equal to 1:2 + 0.5. 2/2 mismatches (average diff: 0.5) [1] 1 - 1.5 == -0.5 [2] 2 - 2.5 == -0.5 -- 2. Failure: Data written in appropriate format (@test-openxlsx.R#108) ------ dfr[[2]] not equal to -1:-2 + 0.5. 2/2 mismatches (average diff: 0.5) [1] 0 - -0.5 == 0.5 [2] -1 - -1.5 == 0.5 your values are being casted to integers at some point. There are 4 places in the test where this may have happened: - huxtable() - as_Workbook() - openxlsx::saveWorkbook() - openxlsx::read.xlsx() I?aki
Sent from Gmail Mobile [[alternative HTML version deleted]]