Skip to content

Commit 92e96d1

Browse files
Use local for clearer test
1 parent 6fc84d8 commit 92e96d1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

inst/tests/tests.Rraw

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21576,5 +21576,8 @@ test(2336.3, capture.output(fwrite(di, forceDecimal=TRUE)), c("x", "1", "2", "3"
2157621576
test(2336.4, capture.output(fwrite(data.table(x=c(0.)), forceDecimal=TRUE)), c("x", "0."))
2157721577
test(2336.5, capture.output(fwrite(data.table(x=c(-0.)), forceDecimal=TRUE)), c("x", "0."))
2157821578
# round trip
21579-
test(2336.6, fread(text=paste0(capture.output(fwrite(dd, forceDecimal=TRUE)), collapse = "\n")), dd)
21580-
test(2336.7, fread(text=paste0(capture.output(fwrite(dd, forceDecimal=FALSE)), collapse = "\n")), di)
21579+
local({
21580+
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)
21583+
})

0 commit comments

Comments
 (0)