Closed DavisVaughan closed 2 years ago
Reasonable test that doesn't rely on clock
x <- new_rcrd(list(x = 1:3, y = 2:4))
expect_identical(map(x, identity), vec_chop(x))
For completely stability, you could manually craft expect
rather than using vec_chop()
We have an internal rlang function that does this (you wouldn't get access even if you import the whole rlang lib) https://github.com/r-lib/rlang/blob/b3327104bac9c9fec90fa081fdd9cb321c3f29bb/src/internal/attr.c#L172
Used like this with
r_is_object()
https://github.com/r-lib/rlang/blob/b3327104bac9c9fec90fa081fdd9cb321c3f29bb/src/internal/attr.c#L96-L101Created on 2022-09-26 with reprex v2.0.2.9000