Skip to content

Commit dece1c6

Browse files
committed
merge tests
1 parent 5410e31 commit dece1c6

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

inst/tests/optimize.Rraw

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,3 @@ test(2283 + 0.18, levels=opts,
445445
test(2283 + 0.19, levels=opts,
446446
names(M[, c(mpg[1], list(mpg, b=hp), c(lapply(.SD, mean))), by="cyl", .SDcols=c("vs", "am")]),
447447
c("cyl", "V1", "V2", "b", "vs", "am"))
448-
449-
# Test lapply(list(...), fun) optimization
450-
dt = as.data.table(iris)
451-
opt = c(0L, 1L)
452-
out = c('GForce FALSE', 'lapply optimization changed j')
453-
test(2284.1, levels=opt, dt[, lapply(list(Petal.Length, Sepal.Length), sum), by=Species, verbose=TRUE], output=out)
454-
test(2284.2, levels=opt, names(dt[, lapply(list(Petal.Length, Sepal.Length), sum), by=Species]))
455-
test(2284.3, levels=opt, dt[, c(list(sum(Petal.Length), sum(Sepal.Length))), by=Species, verbose=TRUE], output=out)

inst/tests/tests.Rraw

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21227,5 +21227,7 @@ dt = data.table(a = NA_integer_, b = 1:2, c = c(TRUE, FALSE))
2122721227
test(2345.04, levels=0:2, dt[, Map(weighted.mean, .SD, na.rm=c), b, .SDcols="a", verbose=TRUE], data.table(b=1:2, a=c(NaN, NA_real_)), output="GForce FALSE")
2122821228
test(2345.05, levels=0:2, dt[,list(weighted.mean(a, na.rm=c)), b, verbose=TRUE], data.table(b=1:2, V1=c(NaN, NA_real_)), output="GForce FALSE")
2122921229
dt = data.table(a=1:2, b=1, c=1:4)
21230-
test(2345.06, levels=1:2, dt[, lapply(list(b, c), sum), by=a, verbose=TRUE], output=c("lapply optimization changed j", "GForce TRUE"))
21231-
test(2345.07, levels=1:2, dt[, c(list(sum(b), sum(c))), by=a, verbose=TRUE], output=c("lapply optimization changed j", "GForce TRUE"))
21230+
out = c("GForce FALSE", "lapply optimization changed j", "GForce TRUE")
21231+
test(2345.06, levels=0:2, dt[, lapply(list(b, c), sum), by=a, verbose=TRUE], output=out)
21232+
test(2345.07, levels=0:2, dt[, c(list(sum(b), sum(c))), by=a, verbose=TRUE], output=out)
21233+
test(2345.08, levels=0:2, names(dt[, lapply(list(b, c), sum), by=a]))

0 commit comments

Comments
 (0)