@@ -198,6 +198,7 @@ base_messages = list(
198198 stopifnot = get_msg(stopifnot(FALSE), fmt="FALSE"),
199199 not_yet_used = get_msg(.NotYetUsed("abc"), "'", fmt=TRUE), # NB: need fmt= because the English message has '(yet)' --> parens in regex
200200 ambiguous_date_fmt = get_msg(as.Date('xxx')),
201+ match_arg_length = get_msg(match.arg(c('a', 'b'), letters))
201202 NULL
202203)
203204
@@ -9973,7 +9974,7 @@ test(1658.27, fwrite(DT, na="NA", verbose=TRUE), output='Writing bom .false., ya
99739974test(1658.28, fwrite(ok_dt, 1), error=base_messages$stopifnot("is.character(file) && length(file) == 1L && !is.na(file)"))
99749975test(1658.29, fwrite(ok_dt, quote=123), error="identical\\(quote.*auto.*FALSE.*TRUE")
99759976test(1658.30, fwrite(ok_dt, sep="..."), error="nchar(sep)")
9976- test(1658.31, fwrite(ok_dt, qmethod=c("double", "double")), error="length(qmethod)" )
9977+ test(1658.31, fwrite(ok_dt, qmethod=c("double", "double")), error=base_messages$match_arg_length )
99779978test(1658.32, fwrite(ok_dt, col.names="foobar"), error="isTRUEorFALSE(col.names)")
99789979
99799980# null data table (no columns)
@@ -10943,7 +10944,7 @@ DT = data.table(
1094310944 D = as.POSIXct(dt<-paste(d,t), tz="UTC"),
1094410945 E = as.POSIXct(paste0(dt,c(".999",".0",".5",".111112",".123456",".023",".0",".999999",".99",".0009")), tz="UTC"))
1094510946
10946- test(1740.0, fwrite(DT,dateTimeAs="iso"), error="dateTimeAs must be ' ISO','squash','epoch' or 'write.csv' ")
10947+ test(1740.0, fwrite(DT,dateTimeAs="iso"), error="ISO")
1094710948test(1740.1, fwrite(DT,dateTimeAs=c("ISO","squash")), error="dateTimeAs must be a single string")
1094810949test(1740.2, capture.output(fwrite(DT,dateTimeAs="ISO")), c(
1094910950"A,B,C,D,E",
0 commit comments