Skip to content

Commit

Permalink
Added test for #2214
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdowle committed Mar 3, 2018
1 parent d3fc8ed commit 5f7b324
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -11794,6 +11794,11 @@ test(1886.1, fread('A,B,C\n1,foo,4\n2,,5\n3,bar,6\n'), data.table(A=1:3, B=c("fo
test(1886.2, fread('A,B,C\n1,foo,4\n2,"",5\n3,bar,6\n'), data.table(A=1:3, B=c("foo","","bar"), C=4:6))
test(1886.3, fread("A,B,C\n1,foo,bar\n2", fill=TRUE), data.table(A=1:2,B=c("foo",NA),C=c("bar",NA)))

# preserving "" and NA_character_, #2214
DT = data.table(chr = c(NA, "", "a"), num = c(NA, NA, 2L))
test(1887.1, fread({fwrite(DT,f<-tempfile());f}), DT); unlink(f)
test(1887.2, capture.output(fwrite(DT)), c("chr,num", ",", "\"\"," , "a,2"))


###################################
# Add new tests above this line #
Expand Down

0 comments on commit 5f7b324

Please sign in to comment.