expect_s[34]_class can check not S3/S4

factor() is an S3 object
A() is an S4 object

test_s4_class respects class hierarchy

C() inherits from 'C'/'A'/'B'/'list'/'vector' not 'D'.

test_s3_class respects class hierarchy

`x` inherits from 'a'/'b' not 'c'.
`x` inherits from 'a'/'b' not 'c'/'d'.

Try the testthat package in your browser

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

testthat documentation built on May 4, 2023, 9:09 a.m.