Skip to content

Commit e5b134f

Browse files
MichaelChiricoben-schwen
authored andcommitted
Re-word test 168 to avoid R strptime bug; test in vi_VN
1 parent bbd37c8 commit e5b134f

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

.github/workflows/R-CMD-check-occasional.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222
# Multibyte characters: Mandarin
2323
'zh_CN.utf8',
2424
# Collate order (#3502, see also #7837): Latvian, Azeri, Hungarian, Faroese, Albanian
25-
'lv_LV.utf8', 'az_AZ.utf8', 'hu_HU.utf8', 'fo_FO.utf8', 'sq_MK.utf8']
25+
'lv_LV.utf8', 'az_AZ.utf8', 'hu_HU.utf8', 'fo_FO.utf8', 'sq_MK.utf8',
26+
# Local time formatting (for R bug #19117)
27+
'vi_VN.utf8']
2628
# we're constrained by GHA inflexibility to do a tedious thing here with 'exclude' below.
2729
# better would be for GHA to support multiple 'matrix' configs (one for ubuntu, one for other OS);
2830
# an approach with multiple jobs would tediously require copy-pasting the _rest_ of the steps

inst/tests/tests.Rraw

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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
641638
DT = data.table(y=1:100,x=101:200,y=201:300,grp=1:5)

0 commit comments

Comments
 (0)