@@ -13,20 +13,29 @@ test_that("dim compared correctly", {
1313 expect_success(expect_shape(array (dim = 1 : 3 ), dim = 1 : 3 ))
1414 expect_snapshot_failure(expect_shape(array (dim = 1 : 3 ), dim = 1 : 2 ))
1515 expect_snapshot_failure(expect_shape(array (dim = 1 : 3 ), dim = 1 : 4 ))
16+ expect_success(expect_shape(array (), dim = 0L ))
17+ dd <- c(0L , 0L , 0L , 5L , 0L , 0L , 0L )
18+ expect_success(expect_shape(array (dim = dd ), dim = dd ))
1619})
1720
1821test_that(" nrow compared correctly" , {
1922 expect_success(expect_shape(matrix (nrow = 5 , ncol = 4 ), nrow = 5L ))
2023 expect_snapshot_failure(expect_shape(matrix (nrow = 5 , ncol = 5 ), nrow = 6L ))
2124 expect_success(expect_shape(data.frame (1 : 10 , 11 : 20 ), nrow = 10L ))
2225 expect_snapshot_failure(expect_shape(1 , nrow = 1 ))
26+ expect_success(expect_shape(array (), nrow = 0L ))
27+ dd <- c(0L , 0L , 0L , 5L , 0L , 0L , 0L )
28+ expect_success(expect_shape(array (dim = dd ), nrow = 0L ))
2329})
2430
2531test_that(" ncol compared correctly" , {
2632 expect_success(expect_shape(matrix (nrow = 5 , ncol = 4 ), ncol = 4L ))
2733 expect_snapshot_failure(expect_shape(matrix (nrow = 5 , ncol = 5 ), ncol = 7L ))
2834 expect_success(expect_shape(data.frame (1 : 10 , 11 : 20 ), ncol = 2L ))
2935 expect_snapshot_failure(expect_shape(array (1 ), ncol = 1 ))
36+ expect_snapshot_failure(expect_shape(array (), ncol = 0L ))
37+ dd <- c(0L , 0L , 0L , 5L , 0L , 0L , 0L )
38+ expect_success(expect_shape(array (dim = dd ), ncol = 0L ))
3039})
3140
3241test_that(" uses S4 dim method" , {
0 commit comments