Skip to content

Commit 10fcb66

Browse files
committed
regression test
1 parent ba7a1b3 commit 10fcb66

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

inst/tests/tests.Rraw

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21921,3 +21921,14 @@ rm(DTn, DTl, DT)
2192121921
DT = unserialize(serialize(as.data.table(mtcars), NULL))
2192221922
test(2353, DT[,foo:=mean(mpg),by=cyl], as.data.table(mtcars)[,foo:=mean(mpg),by=cyl])
2192321923
rm(DT)
21924+
21925+
# as.data.table.array(x) shouldn't overwrite dimnames(x), #7506
21926+
Xdn = list(foo = letters[1:2], bar = LETTERS[1:3], baz = as.character(1:4))
21927+
X = array(1:24, 2:4, copy(Xdn))
21928+
DT = as.data.table(X)
21929+
test(2354.1, dimnames(X), Xdn)
21930+
Xdn['baz'] = list(NULL)
21931+
dimnames(X) = copy(Xdn)
21932+
DT = as.data.table(X)
21933+
test(2354.2, dimnames(X), Xdn)
21934+
rm(X, Xdn, DT)

0 commit comments

Comments
 (0)