Skip to content

Commit b149397

Browse files
committed
Test that vec-ptype methods are found
1 parent e3c5c8c commit b149397

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/testthat/test-type.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ test_that("the type of a classed data frame with an unspecified column retains u
190190
expect_identical(vec_ptype(df2), expect)
191191
})
192192

193+
test_that("vec_ptype() methods can be written", {
194+
local_methods(
195+
vec_ptype.vctrs_foobar = function(x, ...) "dispatch"
196+
)
197+
expect_identical(vec_ptype(foobar()), "dispatch")
198+
})
199+
193200
test_that("vec_ptype_finalise() works with NULL", {
194201
expect_identical(vec_ptype_finalise(NULL), NULL)
195202
})

0 commit comments

Comments
 (0)