Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tests/tests-cube-sdcols.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# tests/tests-cube-sdcols.R
# Test: cube() support for patterns with .SDcols
# Related issue: https://github.com/Rdatatable/data.table/issues/7354

library(data.table)

cat("Running test for cube() with .SDcols pattern...\n")

DT <- data.table(a1 = 1:2, a2 = 3:4, b = 5:6)

result <- tryCatch({
cube(DT, .SDcols = patterns("^a"))
"No error"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move this test into inst/tests.Rraw

and test the output instead of ignoring the output.

}, error = function(e) {
paste("Error:", e$message)
})

cat("Result:", result, "\n")

# Expected: Should ideally handle .SDcols with patterns, but currently errors.

Loading