Skip to content

Commit d61739b

Browse files
committed
test for #1903
1 parent 27f4025 commit d61739b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/testthat/test-type-asis.R

+10
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ test_that("order proxy is forwarded correctly for atomic types (#1557)", {
5050
expect_identical(vec_proxy_order(asis), c(1L, 2L, 1L))
5151
})
5252

53+
test_that("proxy is restored correctly for non-atomic types (#1903)", {
54+
x <- new_rcrd(list(x = 1:3, y = 2:4), class = "test")
55+
x_ptype <- new_rcrd(list(x = integer(), y = integer()), class = "test")
56+
asis <- I(x)
57+
asis_ptype <- I(x_ptype)
58+
59+
expect_identical(vec_restore(vec_proxy(asis), asis_ptype), I(vec_restore(vec_proxy(x), x_ptype)))
60+
expect_identical(vec_restore(vec_proxy(asis), asis_ptype), asis)
61+
})
62+
5363
# ------------------------------------------------------------------------------
5464
# Coercion
5565

0 commit comments

Comments
 (0)