@@ -627,15 +627,12 @@ test(166, suppressWarnings(split(DT,DT$grp)[[2]]), DT[grp==2])
627627# 167 tested graphics::plot, moved to other.Rraw 28 to save ram, #5517
628628
629629# IDateTime conversion methods that ggplot2 uses (it calls as.data.frame method)
630- # Since %b is e.g. "nov." in LC_TIME=fr_FR.UTF-8 locale, we need to
631- # have the target/y value in these tests depend on the locale as well, #3450.
632- NOV = format(strptime("2000-11-01", "%Y-%m-%d"), "%b")
633- x = c("09:29:16","10:42:40","23:47:12","01:06:01","11:35:34","11:51:09")
634- datetimes = paste0("2011 ", NOV, c(18,18,18,19,19,19), " ", x)
635- DT = IDateTime(strptime(datetimes,"%Y %b%d %H:%M:%S"))
636- test(168.1, DT[,as.data.frame(itime)], data.frame(V1=as.ITime(x)))
637- test(168.2, as.character(DT[,as.POSIXct(itime,tz="UTC")]), paste(Sys.Date(), x))
638- test(168.3, as.character(DT[,as.POSIXct(idate,tz="UTC")]), c("2011-11-18","2011-11-18","2011-11-18","2011-11-19","2011-11-19","2011-11-19"))
630+ dates = paste0("2011-11-", rep(18:19, each=3L))
631+ times = c("09:29:16", "10:42:40", "23:47:12", "01:06:01", "11:35:34", "11:51:09")
632+ DT = IDateTime(as.POSIXlt(paste(dates, times)))
633+ test(168.1, DT[, as.data.frame(itime)], data.frame(V1=as.ITime(times)))
634+ test(168.2, as.character(DT[, as.POSIXct(itime, tz="UTC")]), paste(Sys.Date(), times))
635+ test(168.3, as.character(DT[, as.POSIXct(idate, tz="UTC")]), dates)
639636
640637# test of . in formula, using inheritance
641638DT = data.table(y=1:100,x=101:200,y=201:300,grp=1:5)
0 commit comments