Skip to content

Commit 866aa95

Browse files
committed
add test
1 parent d43e866 commit 866aa95

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/testthat/test-sdistribution-Matdist.R

+5-2
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,16 @@ test_that("[.Matdist", {
9595
fun = "pdf"
9696
)
9797

98-
expect_error(m[c(FALSE, FALSE)], "empty")
98+
expect_equal(m$strprint(), "Matdist(20)")
99+
100+
expect_error(m[logical(20)], "empty")
99101

100102
m1 <- m[1]
101103
m12 <- m[1:2]
102104

103105
expect_distribution(m1, "WeightedDiscrete")
104-
expect_distribution(m[c(TRUE, FALSE)], "WeightedDiscrete")
106+
expect_distribution(m[!logical(20)], "Matdist")
107+
expect_distribution(m[c(TRUE, logical(19))], "WeightedDiscrete")
105108
expect_distribution(m12, "Matdist")
106109

107110
expect_equal(unname(m$cdf(0:25)[, 1]), unname(m1$cdf(0:25)))

0 commit comments

Comments
 (0)