Skip to content

Commit 7083a23

Browse files
committed
regression test
1 parent 41e1123 commit 7083a23

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

inst/tests/tests.Rraw

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21876,3 +21876,12 @@ test(2347, DT[i, .(result = all(is.na(grp) == is.na(a))), by = grp][,all(result)
2187621876
DT = data.table(a = as.Date("2010-01-01"), b = 1L)
2187721877
test(2348.1, tryCatch(DT[a == as.Date("20100101")], error=conditionCall)[[1L]], quote(charToDate))
2187821878
test(2348.2, tryCatch(DT[a == as.Date("20100101") | b == 2L], error=conditionCall)[[1L]], quote(charToDate))
21879+
21880+
# rbindlist did not protect the temporary UTF-8 strings, #7452
21881+
DTn = apply(matrix(as.raw(rep(0xa1:0xff, length.out = 100)), 10), 2, rawToChar)
21882+
Encoding(DTn) = 'latin1' # will need conversion to UTF-8
21883+
DTl = lapply(DTn, function(n) setNames(list(42), n))[c(1, rep(2:length(DTn), length.out = 3e5), 1)]
21884+
DT = suppressMessages(rbindlist(DTl)) # used to crash
21885+
test(2349.1, dim(DT), c(300002L, 1L))
21886+
test(2349.2, DT[[1]], rep(42, nrow(DT)))
21887+
rm(DTn, DTl, DT)

0 commit comments

Comments
 (0)