We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04cf5ff commit 405d693Copy full SHA for 405d693
inst/tests/tests.Rraw
@@ -21455,10 +21455,10 @@ test(2331.4, local({
21455
identical(out, "dt")
21456
}))
21457
test(2331.5, local({
21458
- dt <- data.table(x = 1)
21459
- e <- new.env()
21460
- e$dt <- dt
21461
- e$self <- e # actual cycle
21462
- out <- tables(recursive = TRUE, env = e)$NAME
21463
- identical(out, "dt") # should only find 'dt', not 'self$dt' or worse
+ cycle <- list()
+ cycle[[1]] <- cycle
+ cycle[[2]] <- list(cycle) # nested cycle
+ cycle[[3]] <- data.table(x = 1)
+ res <- tables(recursive = TRUE)$NAME
+ "cycle[[3]]" %in% res && all(!grepl("cycle\\[\\[1\\]\\]", res)) && all(!grepl("cycle\\[\\[2\\]", res))
21464
0 commit comments