Skip to content

Commit d511d33

Browse files
ehrlingerclaude
andcommitted
test: tighten patchwork assertion to match corrected plan (#87 Copilot review)
Plan #87 was corrected (via PR #87 Copilot review) to assert patchwork specifically for the 4-predictor iris default-plot case, rather than the loose patchwork||ggplot form that wouldn't catch a regression to a bare list (issue #80). Align the implementation test to match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 919b784 commit d511d33

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/testthat/test_gg_variable.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ test_that("gg_variable.randomForest classification: plot returns patchwork for a
383383
rf <- randomForest::randomForest(Species ~ ., data = iris, ntree = 50L)
384384
gg <- gg_variable(rf)
385385
p <- plot(gg)
386-
expect_true(inherits(p, "patchwork") || inherits(p, "ggplot"))
386+
# iris has 4 predictors so the no-xvar default assembles a multi-panel
387+
# patchwork; assert patchwork specifically to catch regressions to a bare
388+
# list (#80).
389+
expect_s3_class(p, "patchwork")
387390
})
388391

389392
test_that("gg_variable.randomForest classification: layer_data works on single-xvar plot", {

0 commit comments

Comments
 (0)