Skip to content

Commit 476de7e

Browse files
authored
tests: structure(NULL, *) is now an error (#6891)
* tests: structure(NULL, *) is now an error As of R-devel r88075, structure(NULL, ...) signals an error instead of setting attributes on a new list. Test either behaviour depending on the R version and the SVN revision number. * Remove test 944.5
1 parent 2cb0316 commit 476de7e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

inst/tests/tests.Rraw

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2832,9 +2832,8 @@ test(944.1, DT[, foo:=NULL], DT, warning="Tried to assign NULL to column 'foo',
28322832
test(944.2, DT[,a:=1L], data.table(a=1L)) # can now add columns to an empty data.table from v1.12.2
28332833
test(944.3, DT[,aa:=NULL], data.table(a=1L), warning="Tried to assign NULL to column 'aa', but this column does not exist to remove")
28342834
test(944.4, DT[,a:=NULL], data.table(NULL))
2835-
if (base::getRversion() >= "3.4.0") {
2836-
test(944.5, typeof(structure(NULL, class=c("data.table","data.frame"))), 'list', warning="deprecated, as NULL cannot have attributes") # R warns which is good and we like
2837-
}
2835+
# 944.5 used to test base R behaviour regarding structure(NULL, ...), which changed from warning to error in 4.6.0 and isn't used in data.table.
2836+
28382837
DT = data.table(a=numeric())
28392838
test(945, DT[,b:=a+1], data.table(a=numeric(),b=numeric()))
28402839

0 commit comments

Comments
 (0)