Skip to content

Commit a7d66a5

Browse files
authored
Update test_policy_tree.R (#144)
1 parent 0518344 commit a7d66a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

r-package/policytree/tests/testthat/test_policy_tree.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ test_that("min.node.size works as expected", {
352352

353353
tree.min <- policy_tree(X, Y, depth = depth, min.node.size = smallest.leaf + 5)
354354
leaf.sizes.min <- summary(as.factor(predict(tree.min, X, type = "node.id")))
355-
expect_true(all(leaf.sizes.min >= smallest.leaf + 5))
355+
expect_true(smallest.leaf == n || all(leaf.sizes.min >= smallest.leaf + 5))
356356

357357
# Discrete X
358358
X <- matrix(sample(1:5, n, TRUE), n, p)
@@ -361,5 +361,5 @@ test_that("min.node.size works as expected", {
361361

362362
tree.min <- policy_tree(X, Y, depth = depth, min.node.size = smallest.leaf + 5)
363363
leaf.sizes.min <- summary(as.factor(predict(tree.min, X, type = "node.id")))
364-
expect_true(all(leaf.sizes.min >= smallest.leaf + 5))
364+
expect_true(smallest.leaf == n || all(leaf.sizes.min >= smallest.leaf + 5))
365365
})

0 commit comments

Comments
 (0)