Skip to content

Commit b942b66

Browse files
committed
Add test for cube() support with .SDcols patterns (issue #7354)
1 parent df7fa80 commit b942b66

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/tests-cube-sdcols.R

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# tests/tests-cube-sdcols.R
2+
# Test: cube() support for patterns with .SDcols
3+
# Related issue: https://github.com/Rdatatable/data.table/issues/7354
4+
5+
library(data.table)
6+
7+
cat("Running test for cube() with .SDcols pattern...\n")
8+
9+
DT <- data.table(a1 = 1:2, a2 = 3:4, b = 5:6)
10+
11+
result <- tryCatch({
12+
cube(DT, .SDcols = patterns("^a"))
13+
"No error"
14+
}, error = function(e) {
15+
paste("Error:", e$message)
16+
})
17+
18+
cat("Result:", result, "\n")
19+
20+
# Expected: Should ideally handle .SDcols with patterns, but currently errors.
21+

0 commit comments

Comments
 (0)