inst/tinytest/test_rev.R

# ---------
# rev.Deque
# ---------
v = 1:5
d = as.deque(v)
expect_equal(unpack(d), v)

expect_equal(unpack(rev(d)), rev(v))
d_was_changed = !identical(unpack(d), v)
expect_false(d_was_changed)

expect_equal(unpack(ref_rev(d)), rev(v))
expect_equal(unpack(d), rev(v))

Try the container package in your browser

Any scripts or data that you put into this service are public.

container documentation built on Dec. 11, 2022, 5:19 p.m.