[R-pkg-devel] Another CRAN-only bug

David Hugh-Jones d@v|dhughjone@ @end|ng |rom gm@||@com
Thu Jun 13 12:33:28 CEST 2019


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 using fedoraproject.org> wrote:

> On Thu, 13 Jun 2019 at 10:41, David Hugh-Jones <davidhughjones using gmail.com>
> wrote:
> >
> >  Well, the test that fails is this one:
> >
> https://win-builder.r-project.org/incoming_pretest/huxtable_4.6.0_20190612_195453/Windows/examples_and_tests/tests_x64/testthat/test-openxlsx.R
> >
> >
> > 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]]



More information about the R-package-devel mailing list