From 2b7d22502ba52132e97f04ada1766e1d341f043b Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 13 Nov 2019 20:49:24 -0500
Subject: [PATCH] Fix test 1729 on ppc64le.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
inst/tests/tests.Rraw | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw
index f5f71366..f211f62f 100644
--- a/inst/tests/tests.Rraw
+++ b/inst/tests/tests.Rraw
@@ -10472,7 +10472,7 @@ if (test_longdouble) { #3258
test(1729.05, nrow(DT), 507L)
x = capture.output(fwrite(DT,na="NA"))[-1] # -1 to remove the column name V1
- y = capture.output(write.csv(DT,row.names=FALSE,quote=FALSE))[-1]
+ y = gsub("\\.?0+e", "e", capture.output(write.csv(DT,row.names=FALSE,quote=FALSE))[-1])
# One mismatch that seems to be accuracy in base R's write.csv
# tmp = cbind(row=1:length(x), `fwrite`=x, `write.csv`=y)
# tmp[x!=y,]
@@ -10515,12 +10515,12 @@ if (test_longdouble) { #3258
"0 00000001010 000101000110010100110011101010000110 00111110 01010001",
"0 11111110100 011001101011100100100011110110110000 01001110 01011101"))
test(1729.10, fwrite(DT,na=""), output=ans)
- test(1729.11, write.csv(DT,row.names=FALSE,quote=FALSE), output=ans)
+ test(1729.11, gsub("\\.?0+e", "e", capture.output(write.csv(DT,row.names=FALSE,quote=FALSE))), ans)
DT = data.table(unlist(.Machine[c("double.eps","double.neg.eps","double.xmin","double.xmax")]))
# double.eps double.neg.eps double.xmin double.xmax
# 2.220446e-16 1.110223e-16 2.225074e-308 1.797693e+308
test(1729.12, typeof(DT[[1L]]), "double")
- test(1729.13, capture.output(fwrite(DT)), capture.output(write.csv(DT,row.names=FALSE,quote=FALSE)))
+ test(1729.13, capture.output(fwrite(DT)), gsub("\\.?0+e", "e", capture.output(write.csv(DT,row.names=FALSE,quote=FALSE))))
options(old) # restore the previous datatable.verbose value, for example for the CRAN_Release test with verbose on
}
--
2.26.2