Skip to content

Commit 597a5b3

Browse files
committed
..
1 parent 26bd48a commit 597a5b3

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

inst/tests/tests.Rraw

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21458,10 +21458,16 @@ test(2332.4, local({
2145821458
identical(out, "dt")
2145921459
}))
2146021460
test(2332.5, local({
21461-
cycle <- list()
21462-
cycle[[1]] <- cycle
21463-
cycle[[2]] <- list(cycle) # nested cycle
21464-
cycle[[3]] <- data.table(x = 1)
21465-
res <- tables(recursive = TRUE)$NAME
21466-
"cycle[[3]]" %in% res && all(!grepl("cycle\\[\\[1\\]\\]", res)) && all(!grepl("cycle\\[\\[2\\]", res))
21461+
test_obj <- local({
21462+
common_list <- list(dt_inner = data.table(d = 4))
21463+
outer_list <- list(
21464+
first = common_list,
21465+
unique = data.table(e = 5))
21466+
outer_list$second <- outer_list$first
21467+
outer_list
21468+
})
21469+
out <- tables(recursive = TRUE)$NAME
21470+
(length(out) == 2) &&
21471+
("test_obj$unique" %in% out) &&
21472+
(sum(grepl("\\$dt_inner$", out)) == 1)
2146721473
}))

0 commit comments

Comments
 (0)