Skip to content

Commit

Permalink
test for #1903
Browse files Browse the repository at this point in the history
  • Loading branch information
mjskay committed Dec 21, 2023
1 parent 27f4025 commit d61739b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/testthat/test-type-asis.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ test_that("order proxy is forwarded correctly for atomic types (#1557)", {
expect_identical(vec_proxy_order(asis), c(1L, 2L, 1L))
})

test_that("proxy is restored correctly for non-atomic types (#1903)", {
x <- new_rcrd(list(x = 1:3, y = 2:4), class = "test")
x_ptype <- new_rcrd(list(x = integer(), y = integer()), class = "test")
asis <- I(x)
asis_ptype <- I(x_ptype)

expect_identical(vec_restore(vec_proxy(asis), asis_ptype), I(vec_restore(vec_proxy(x), x_ptype)))
expect_identical(vec_restore(vec_proxy(asis), asis_ptype), asis)
})

# ------------------------------------------------------------------------------
# Coercion

Expand Down

0 comments on commit d61739b

Please sign in to comment.