Skip to content

Commit 91b20a9

Browse files
ws style
1 parent d79b465 commit 91b20a9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

inst/tests/tests.Rraw

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21532,35 +21532,35 @@ unlink(f)
2153221532

2153321533
#2606 Recursive tables() naming convention
2153421534
local({
21535-
lst_named <- list(inner = data.table(a = 1))
21536-
lst_unnamed <- list(data.table(b = 2))
21537-
nested <- list(l1 = list(l2 = data.table(c = 3)))
21538-
mixed <- list(data.table(x = 1), y = data.table(z = 2))
21539-
mixed_nested <- list(A = list(data.table(p = 1), q = data.table(q = 2)))
21540-
out <- tables(recursive = TRUE)$NAME
21535+
lst_named <- list(inner=data.table(a=1))
21536+
lst_unnamed <- list(data.table(b=2))
21537+
nested <- list(l1=list(l2=data.table(c=3)))
21538+
mixed <- list(data.table(x=1), y=data.table(z=2))
21539+
mixed_nested <- list(A=list(data.table(p=1), q=data.table(q=2)))
21540+
out <- tables(recursive=TRUE)$NAME
2154121541
expected <- c(
2154221542
"lst_named$inner", "lst_unnamed[[1]]", "nested$l1$l2",
2154321543
"mixed[[1]]", "mixed$y",
2154421544
"mixed_nested$A[[1]]", "mixed_nested$A$q")
2154521545
test(2335.1, identical(out, sort(expected)))
2154621546
})
2154721547
local({
21548-
dt <- data.table(val = 42)
21548+
dt <- data.table(val=42)
2154921549
e <- new.env()
2155021550
e$dt <- dt
2155121551
e$self <- e
21552-
out <- tables(recursive = TRUE, env = e)$NAME
21552+
out <- tables(recursive=TRUE, env=e)$NAME
2155321553
test(2335.2, identical(out, "dt"))
2155421554
})
2155521555
local({
2155621556
test_obj <- local({
21557-
common_list <- list(dt_inner = data.table(d = 4))
21557+
common_list <- list(dt_inner=data.table(d=4))
2155821558
outer_list <- list(
21559-
first = common_list,
21560-
unique = data.table(e = 5))
21559+
first=common_list,
21560+
unique=data.table(e=5))
2156121561
outer_list$second <- outer_list$first
2156221562
outer_list})
21563-
out <- tables(recursive = TRUE)$NAME
21563+
out <- tables(recursive=TRUE)$NAME
2156421564
test(2335.3,
2156521565
(length(out) == 2) &&
2156621566
("test_obj$unique" %in% out) &&

0 commit comments

Comments
 (0)