Skip to content

Commit 560b23d

Browse files
notcopied implementation
1 parent 0125e3b commit 560b23d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

inst/tests/mergelist.Rraw

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ copied = function(ans, l) {
1919
}
2020
notcopied = function(ans, l, how="left", unless=character()) {
2121
if (how %chin% unless) return(copied(ans, l)) ## used during looping tests for easier escape
22-
if (how=="full") return( ## either side, left|right, notcopied is fine
23-
all(addresses(l[[1L]]) %chin% addresses(ans)) || all(addresses(l[[length(l)]]) %chin% addresses(ans))
22+
if (how == "full") return( ## either side, left|right, notcopied is fine
23+
all(addresses(l[[1L]]) %chin% addresses(ans)) ||
24+
all(addresses(l[[length(l)]]) %chin% addresses(ans))
2425
)
25-
all(addresses(if (how=="right") l[[length(l)]] else l[[1L]]) %chin% addresses(ans))
26+
idx = if (how == "right") length(l) else 1L
27+
all(addresses(l[[idx]]) %chin% addresses(ans))
2628
}
2729

2830
# internal helpers

0 commit comments

Comments
 (0)