Open
Description
According to the documentation, "the first argument to every expect_ function can use unquoting to construct better labels". But this is not the case for expect_s4_class()
:
library(testthat)
a <- list(b = 3)
i <- "b"
# unqoting works for expect_s3_class()
expect_s3_class(a[[!!i]], "data.frame")
#> Error: a[["b"]] is not an S3 object
# but not for expect_s4_class()
expect_s4_class(a[[!!i]], "s4_class")
#> Error in !i: invalid argument type
Created on 2025-03-02 with reprex v2.1.1
Metadata
Metadata
Assignees
Labels
No labels