Skip to content

Commit 578bff0

Browse files
dec= test
1 parent 92e96d1 commit 578bff0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

inst/tests/tests.Rraw

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21571,13 +21571,14 @@ test(2335.6, isoyear(as.Date("2019-12-30")), 2020L)
2157121571
dd = data.table(x=c(1, 2, 3))
2157221572
di = data.table(x=c(1L, 2L, 3L))
2157321573
test(2336.1, capture.output(fwrite(dd, forceDecimal=TRUE)), c("x", "1.", "2.", "3."))
21574-
test(2336.2, capture.output(fwrite(dd, forceDecimal=FALSE)), c("x", "1", "2", "3"))
21575-
test(2336.3, capture.output(fwrite(di, forceDecimal=TRUE)), c("x", "1", "2", "3"))
21576-
test(2336.4, capture.output(fwrite(data.table(x=c(0.)), forceDecimal=TRUE)), c("x", "0."))
21577-
test(2336.5, capture.output(fwrite(data.table(x=c(-0.)), forceDecimal=TRUE)), c("x", "0."))
21574+
test(2336.2, capture.output(fwrite(dd, forceDecimal=TRUE, dec=",", sep="\t")), c("x", "1,", "2,", "3,"))
21575+
test(2336.3, capture.output(fwrite(dd, forceDecimal=FALSE)), c("x", "1", "2", "3"))
21576+
test(2336.4, capture.output(fwrite(di, forceDecimal=TRUE)), c("x", "1", "2", "3"))
21577+
test(2336.5, capture.output(fwrite(data.table(x=c(0.)), forceDecimal=TRUE)), c("x", "0."))
21578+
test(2336.6, capture.output(fwrite(data.table(x=c(-0.)), forceDecimal=TRUE)), c("x", "0."))
2157821579
# round trip
2157921580
local({
2158021581
f <- tempfile(); on.exit(unlink(f))
21581-
test(2336.6, {fwrite(dd, f, forceDecimal=TRUE); fread(f)}, dd)
21582-
test(2336.7, {fwrite(dd, f, forceDecimal=FALSE); fread(f)}, di)
21582+
test(2336.7, {fwrite(dd, f, forceDecimal=TRUE); fread(f)}, dd)
21583+
test(2336.8, {fwrite(dd, f, forceDecimal=FALSE); fread(f)}, di)
2158321584
})

0 commit comments

Comments
 (0)