@@ -1816,25 +1816,25 @@ if (use.fork) {
18161816 test(6010.764, frollapply(c(1, 5, 9), N=1L, FUN=identity), c(5,5,9)) ## unexpected again
18171817 ans = frollapply(1:2, 2, data.table)
18181818 is.ok = function(x) {stopifnot(is.data.table(x)); out=capture.output(print(attr(x, ".internal.selfref", TRUE))); out!="<pointer: (nil)>" && out!="<pointer: 0x0>"}
1819- test(6010.769, is .ok(ans)) ## frollapply will fix DT in most cases
1819+ test(6010.769, .selfref .ok(ans)) ## frollapply will fix DT in most cases
18201820 ans = frollapply(1:2, 2, data.table, simplify=FALSE) ## default: fill=NA
1821- test(6010.770, is .ok(ans[[2L]])) ## frollapply detected DT and fixed
1821+ test(6010.770, .selfref .ok(ans[[2L]])) ## frollapply detected DT and fixed
18221822 ans = frollapply(1:2, 2, data.table, fill=data.table(c(NA,NA))) ## fill size match
1823- test(6010.771, is .ok(ans)) ## simplify=TRUE did run rbindlist, but frollapply fixed anyway
1823+ test(6010.771, .selfref .ok(ans)) ## simplify=TRUE did run rbindlist, but frollapply fixed anyway
18241824 ans = frollapply(1:2, 2, data.table, fill=data.table(NA)) ## fill size not match, no rbindlist, but frollapply fixed anyway
1825- test(6010.772, is .ok(ans[[2L]]))
1825+ test(6010.772, .selfref .ok(ans[[2L]]))
18261826 ans = frollapply(1:2, 2, function(x) list(data.table(x)), fill=list(data.table(NA)), simplify=FALSE)
1827- test(6010.773, !is .ok(ans[[2L]][[1L]]))
1827+ test(6010.773, !.selfref .ok(ans[[2L]][[1L]]))
18281828 test(6010.7731, set(ans[[2L]][[1L]],, "newcol", 1L), error="data.table has either been loaded from disk")
18291829 ans = lapply(ans, lapply, setDT)
1830- test(6010.774, is .ok(ans[[2L]][[1L]])) ## fix after
1830+ test(6010.774, .selfref .ok(ans[[2L]][[1L]])) ## fix after
18311831 ans = frollapply(1:2, 2, function(x) list(data.table(x)), fill=list(data.table(NA)), simplify=function(x) lapply(x, lapply, setDT))
1832- test(6010.775, is .ok(ans[[2L]][[1L]])) ## fix inside frollapply via simplify
1832+ test(6010.775, .selfref .ok(ans[[2L]][[1L]])) ## fix inside frollapply via simplify
18331833 f = function(x) (if (x[1L]==1L) data.frame else data.table)(x) ## automatic fix may not work for a non-type stable function
18341834 ans = frollapply(1:3, 2, f, fill=data.table(NA), simplify=FALSE)
1835- test(6010.776, !is .ok(ans[[3L]]))
1835+ test(6010.776, !.selfref .ok(ans[[3L]]))
18361836 ans = frollapply(1:3, 2, f, fill=data.table(NA), simplify=function(x) lapply(x, function(y) if (is.data.table(y)) setDT(y) else y))
1837- test(6010.777, is .ok(ans[[3L]])) ## fix inside frollapply via simplify
1837+ test(6010.777, .selfref .ok(ans[[3L]])) ## fix inside frollapply via simplify
18381838 setDTthreads(old, throttle=1024) ## re-enable throttle
18391839}
18401840
0 commit comments