Skip to content

Commit f39df47

Browse files
committed
updated tests
1 parent acdb19d commit f39df47

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

inst/tests/tests.Rraw

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21525,7 +21525,7 @@ test(2332.81, {M1[]=frev(M1); M1}, {M2[]=rev(M2); M2})
2152521525
test(2333, as.expression(data.table(a = 1))[["a"]], 1)
2152621526

2152721527
#2606 Recursive tables() naming convention
21528-
test(2334.1, local({
21528+
local({
2152921529
lst_named <- list(inner = data.table(a = 1))
2153021530
lst_unnamed <- list(data.table(b = 2))
2153121531
nested <- list(l1 = list(l2 = data.table(c = 3)))
@@ -21535,28 +21535,28 @@ test(2334.1, local({
2153521535
expected <- c(
2153621536
"lst_named$inner", "lst_unnamed[[1]]", "nested$l1$l2",
2153721537
"mixed[[1]]", "mixed$y",
21538-
"mixed_nested$A[[1]]", "mixed_nested$A$q"
21539-
)
21540-
identical(out, sort(expected))
21541-
}))
21542-
test(2334.2, local({
21538+
"mixed_nested$A[[1]]", "mixed_nested$A$q")
21539+
test(2334.1, identical(out, sort(expected)))
21540+
})
21541+
local({
2154321542
dt <- data.table(val = 42)
2154421543
e <- new.env()
2154521544
e$dt <- dt
2154621545
e$self <- e
2154721546
out <- tables(recursive = TRUE, env = e)$NAME
21548-
identical(out, "dt")
21549-
}))
21550-
test(2334.3, local({
21547+
test(2334.2, identical(out, "dt"))
21548+
})
21549+
local({
2155121550
test_obj <- local({
2155221551
common_list <- list(dt_inner = data.table(d = 4))
2155321552
outer_list <- list(
2155421553
first = common_list,
2155521554
unique = data.table(e = 5))
21556-
outer_list$second <- outer_list$first
21555+
outer_list$second <- outer_list$first
2155721556
outer_list})
2155821557
out <- tables(recursive = TRUE)$NAME
21559-
(length(out) == 2) &&
21560-
("test_obj$unique" %in% out) &&
21561-
(sum(grepl("\\$dt_inner$", out)) == 1)
21562-
}))
21558+
test(2334.3,
21559+
(length(out) == 2) &&
21560+
("test_obj$unique" %in% out) &&
21561+
(sum(grepl("\\$dt_inner$", out)) == 1))
21562+
})

0 commit comments

Comments
 (0)