File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ test_that("length compared correctly", {
33 expect_snapshot_failure(expect_shape(1 , length = 2 ))
44 expect_success(expect_shape(1 : 10 , length = 10 ))
55 expect_success(expect_shape(letters [1 : 5 ], length = 5 ))
6+ expect_success(expect_shape(integer(), length = 0 ))
67})
78
89test_that(" dim compared correctly" , {
@@ -38,6 +39,13 @@ test_that("ncol compared correctly", {
3839 expect_success(expect_shape(array (dim = dd ), ncol = 0L ))
3940})
4041
42+ test_that(" uses S3 dim method" , {
43+ dim.testthat_expect_shape <- function (x ) 1 : 2
44+ x <- integer()
45+ class(x ) <- " testthat_expect_shape"
46+ expect_success(expect_shape(x , dim = 1 : 2 ))
47+ })
48+
4149test_that(" uses S4 dim method" , {
4250 A <- setClass ("ExpectShapeA ", slots = c(x = "numeric", y = "numeric"))
4351 setMethod ("dim ", "ExpectShapeA", function(x) 8:10)
You can’t perform that action at this time.
0 commit comments