Skip to content

Commit

Permalink
Another attempt to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
philippechataignon committed Jan 10, 2025
1 parent aabe089 commit b9aa14d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/fwrite.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ fwrite = function(x, file="", append=FALSE, quote="auto",
encoding = "") {
na = as.character(na[1L]) # fix for #1725
if (length(encoding) != 1L || !encoding %chin% c("", "UTF-8", "native")) {
stopf("Argument 'encoding' must be '', 'UTF-8' or 'native'.")
stopf("Argument 'encoding' must be '', 'UTF-8' or 'native'.") # nocov
}
qmethod = match.arg(qmethod)
compress = match.arg(compress)
dateTimeAs = match.arg(dateTimeAs)
dateTimeAs = chmatch(dateTimeAs, c("ISO", "squash", "epoch", "write.csv"))-1L
if (!is.null(logicalAsInt)) {
stopf("logicalAsInt has been renamed logical01 for consistency with fread.")
stopf("logicalAsInt has been renamed logical01 for consistency with fread.") # nocov
}
scipen = if (is.numeric(scipen)) as.integer(scipen) else 0L
buffMB = as.integer(buffMB)
Expand Down
2 changes: 1 addition & 1 deletion inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -10104,7 +10104,7 @@ test(1658.59, fwrite(data.table(a=list('a')), verbose=TRUE),
output='fields will be quoted if the field contains either sep.*sep2.*list column')
test(1658.60, fwrite(data.table(r=as.raw(0))), error = "'raw' - not yet implemented")
## naLen is bigger than col width for coverage
test(1658.61, fwrite(data.table(a="a"), na="VERY LONG MISSING VALUE STRING !", quote=FALSE), output="a\na")
test(1658.61, fwrite(data.table(a="a"), na="VERY LONG MISSING VALUE STRING !", quote=FALSE, verbose=TRUE), output="a\na")

options(oldverbose)
## End fwrite tests
Expand Down
2 changes: 1 addition & 1 deletion src/fwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ void fwriteMain(fwriteMainArgs args)
// When NA is a non-empty string, then we must quote all string fields in case they contain the na string
// na is recommended to be empty, though
if (na[0]!='\0' && doQuote==INT8_MIN)
doQuote = true;
doQuote = true; // # nocov

qmethodEscape = args.qmethodEscape;
squashDateTime = args.squashDateTime;
Expand Down

0 comments on commit b9aa14d

Please sign in to comment.