Skip to content

Commit d854391

Browse files
authored
tests: don't use .Date() (#7192)
Since .Date() is only available in R >= 3.5, construct the objects by hand instead.
1 parent 6de9d7a commit d854391

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

inst/tests/tests.Rraw

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6852,11 +6852,12 @@ test(1463.79, shift(x,-1L, type="cyclic"), as.raw(c(2:5, 1)))
68526852
test(1463.80, shift(x,-(1:2),type="cyclic"), list(as.raw(c(2:5, 1)), as.raw(c(3:5,1:2))))
68536853

68546854
# shift incompatible types (e.g. Date and POSIXct)
6855-
d = .Date(0:4)
6855+
# TODO(R>=3.5): use .Date() instead of setting class by hand
6856+
d = structure(0:4, class="Date")
68566857
p = .POSIXct(1:5)
68576858
test(1463.81, shift(d, fill=p[1L]), error="Filling Date with POSIXct .* unsupported.*")
68586859
test(1463.82, shift(p, fill=d[1L]), error="Filling POSIXct with Date .* unsupported.*")
6859-
test(1463.83, shift(d, fill=as.IDate(2000L)), .Date(c(2000L, 0:3)))
6860+
test(1463.83, shift(d, fill=as.IDate(2000L)), structure(c(2000L, 0:3), class="Date"))
68606861

68616862
# FR #686
68626863
DT = data.table(a=rep(c("A", "B", "C", "A", "B"), c(2,2,3,1,2)), foo=1:10)

0 commit comments

Comments
 (0)