Skip to content

Commit 2fe3099

Browse files
Add test for compressLevel=1
1 parent 024a34d commit 2fe3099

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

inst/tests/tests.Rraw

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10015,8 +10015,10 @@ if (!haszlib()) {
1001510015
test(1658.423, file.info(f1)$size < file.info(f2)$size) # 74 < 804 (file.size() isn't available in R 3.1.0)
1001610016
if (test_R.utils) test(1658.43, fread(f1), DT) # use fread to decompress gz (works cross-platform)
1001710017
fwrite(DT, file=f3<-tempfile(), compress="gzip") # compress to filename not ending .gz
10018+
fwrite(DT, file=f4<-tempfile(), compress="gzip", compressLevel=1) # test compressLevel
1001810019
test(1658.441, file.info(f3)$size, file.info(f1)$size)
10019-
unlink(c(f1,f2,f3))
10020+
test(1658.442, file.info(f4)$size > file.info(f1)$size, TRUE)
10021+
unlink(c(f1,f2,f3,f4))
1002010022
}
1002110023
DT = data.table(a=1:3, b=list(1:4, c(3.14, 100e10), c("foo", "bar", "baz")))
1002210024
test(1658.45, fwrite(DT), output=c("a,b","1,1|2|3|4","2,3.14|1e+12","3,foo|bar|baz"))

0 commit comments

Comments
 (0)