Skip to content

Commit

Permalink
Optionally skip test relying on R>=4.1.0 behavior (#6277)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Jul 16, 2024
1 parent ea41ac7 commit fdb9d0c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -18337,8 +18337,10 @@ dt = data.table(x=1:4, y=factor(letters[1:2]))
test(2247.1, split(dt, ~y), split(dt, dt$y))
dt = data.table(x=1:4, y=1:2)
test(2247.2, split(dt, ~y), list(`1`=data.table(x=c(1L,3L), y=1L), `2`=data.table(x=c(2L, 4L), y=2L)))
# Closely match the original MRE from the issue
test(2247.3, do.call(rbind, split(dt, ~y)), setDT(do.call(rbind, split(as.data.frame(dt), ~y))))
if (!inherits(tryCatch(split(mtcars, ~cyl), error=identity), "error")) { # R>=4.1.0
# Closely match the original MRE from the issue
test(2247.3, do.call(rbind, split(dt, ~y)), setDT(do.call(rbind, split(as.data.frame(dt), ~y))))
}
dt = data.table(x=1:4, y=factor(letters[1:2]), z=factor(c(1,1,2,2), labels=c("c", "d")))
test(2247.4, split(dt, ~y+z), list("a.c"=dt[1], "b.c"=dt[2], "a.d"=dt[3], "b.d"=dt[4]))

Expand Down

0 comments on commit fdb9d0c

Please sign in to comment.