From ed6fb27590bd34cc219e69167dca1a9f5acb8424 Mon Sep 17 00:00:00 2001 From: mattdowle Date: Thu, 20 Sep 2018 16:55:31 -0700 Subject: [PATCH] Test 1750.22 robustified for side-issue in #3055 --- inst/tests/tests.Rraw | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw index 4382cc4664..32f859e384 100644 --- a/inst/tests/tests.Rraw +++ b/inst/tests/tests.Rraw @@ -10259,9 +10259,10 @@ test(1750.19, uniqueN({ # entries in `by` / `sets` not exists in data.table test(1750.20, groupingsets(dt, j = c(list(cnt=.N), lapply(.SD, sum)), by = c("color","year","stat"), sets=list(c("color"), character()), id=TRUE), error = "object 'stat' not found") test(1750.21, groupingsets(dt, j = c(list(cnt=.N), lapply(.SD, sum)), by = c("color","year","status"), sets=list(c("color"), "stat"), id=TRUE), error = "Columns used in 'sets' but not present in 'by': stat") -test(1750.22, groupingsets(dt, j = .(a=sum(a)), by = c("color","year","status"), sets=list(c("color"), character()), id=TRUE), error = "object 'a' not found") +test(1750.22, exists("notexist"), FALSE) # https://github.com/Rdatatable/data.table/issues/3055#issuecomment-423364960 +test(1750.23, groupingsets(dt, j = .(a=sum(notexist)), by = c("color","year","status"), sets=list(c("color"), character()), id=TRUE), error = "object 'notexist' not found") # update by ref `:=` forbidden -test(1750.23, +test(1750.24, groupingsets(dt, j = sum_value := sum(value), by = c("color","year","status"), sets=list(c("color"), character())), error = "Expression passed to grouping sets function must not update by reference." )