Skip to content

Commit fc8b409

Browse files
committed
add coverage
1 parent 2102755 commit fc8b409

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

inst/tests/tests.Rraw

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21689,3 +21689,4 @@ test(2340.06, .selfref.ok(d3), TRUE)
2168921689
# fread select= and drop= with duplicated column names #6729
2169021690
test(2341.1, fread("x1,x1,y\n2,3,4", select="x1"), data.table(x1=2L, x1=3L))
2169121691
test(2342.2, fread("x1,x1,y\n2,3,4", drop="x1"), data.table(y=4L))
21692+
test(2342.3, fread("x1,x1,y\n2,3,4", drop=NA_character_), data.table(x1=2L, x1=3L, y=4L), warning="drop.*=NA")

src/freadR.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ static void applyDrop(SEXP items, int8_t *type, int ncol, int dropSource)
249249
else snprintf(buff, sizeof(buff), "colClasses[[%d]][%d]", dropSource + 1, j + 1); // # notranslate
250250
SEXP thisItem = STRING_ELT(items, j);
251251
if (thisItem == NA_STRING) {
252-
DTWARN(_("%s is NA"), buff);
252+
DTWARN(_("%s=NA"), buff);
253253
continue;
254254
}
255255
if (!found[j])
@@ -267,7 +267,7 @@ static void applyDrop(SEXP items, int8_t *type, int ncol, int dropSource)
267267
char buff[50];
268268
if (dropSource == -1) snprintf(buff, sizeof(buff), "drop[%d]", j + 1); // # notranslate
269269
else snprintf(buff, sizeof(buff), "colClasses[[%d]][%d]", dropSource + 1, j + 1); // # notranslate
270-
if (k == NA_INTEGER) DTWARN(_("%s is NA"), buff);
270+
if (k == NA_INTEGER) DTWARN(_("%s=NA"), buff);
271271
else DTWARN(_("%s is %d which is out of range [1,ncol=%d]"), buff, k, ncol);
272272
} else {
273273
type[k - 1] = CT_DROP;

0 commit comments

Comments
 (0)