Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 20, 2024
1 parent cabbabd commit bbf30f9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ggeffects 1.6.1
# ggeffects 1.7.0

## Breaking

Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This release fixes issues related to the last *marginaleffects* updates.
Maintainance release.
18 changes: 9 additions & 9 deletions tests/testthat/test-brms-ppd.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ test_that("ggpredict, brms-ppd", {
iter = 500,
refresh = 0
))
expect_s3_class(suppressWarnings(ggpredict(m1, ppd = TRUE)), c("ggalleffects", "list"))
expect_s3_class(suppressWarnings(ggpredict(m1, "x", ppd = TRUE)), "data.frame")
expect_s3_class(suppressWarnings(ggpredict(m1, interval = "prediction")), c("ggalleffects", "list"))
expect_s3_class(suppressWarnings(ggpredict(m1, "x", interval = "prediction")), "data.frame")
expect_s3_class(ggpredict(m1, interval = "prediction"), c("ggalleffects", "list"))
expect_s3_class(ggpredict(m1, "x", interval = "prediction"), "data.frame")
expect_s3_class(suppressWarnings(ggpredict(m2, ppd = TRUE)), c("ggalleffects", "list"))
expect_s3_class(suppressWarnings(ggpredict(m2, "x", ppd = TRUE)), "data.frame")
expect_s3_class(ggpredict(m1, ppd = FALSE), c("ggalleffects", "list"))
expect_s3_class(ggpredict(m1, "x", ppd = FALSE), "data.frame")
expect_s3_class(ggpredict(m2, ppd = FALSE), c("ggalleffects", "list"))
expect_s3_class(ggpredict(m2, "x", ppd = FALSE), "data.frame")
expect_s3_class(suppressWarnings(ggpredict(m2, interval = "prediction")), c("ggalleffects", "list"))
expect_s3_class(suppressWarnings(ggpredict(m2, "x", interval = "prediction")), "data.frame")
expect_s3_class(ggpredict(m1, interval = "confidence"), c("ggalleffects", "list"))
expect_s3_class(ggpredict(m1, "x", interval = "confidence"), "data.frame")
expect_s3_class(ggpredict(m2, interval = "confidence"), c("ggalleffects", "list"))
expect_s3_class(ggpredict(m2, "x", interval = "confidence"), "data.frame")

set.seed(123)
out1 <- suppressWarnings(ggpredict(m1, "x", ppd = TRUE))
out1 <- suppressWarnings(ggpredict(m1, "x", interval = "prediction"))
set.seed(123)
out2 <- ggpredict(m1, "x", interval = "prediction")
expect_equal(out1$predicted, out2$predicted, tolerance = 1e-3)
Expand Down
18 changes: 9 additions & 9 deletions tests/testthat/test-rstanarm-ppd.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ test_that("ggpredict, rstanarm-ppd", {
refresh = 0
))

expect_s3_class(suppressWarnings(ggpredict(m1, ppd = TRUE)), "ggalleffects")
expect_s3_class(suppressWarnings(ggpredict(m1, "x", ppd = TRUE)), "data.frame")
expect_s3_class(suppressWarnings(ggpredict(m2, ppd = TRUE)), "ggalleffects")
expect_s3_class(suppressWarnings(ggpredict(m2, "x", ppd = TRUE)), "data.frame")
expect_error(ggpredict(m1, ppd = FALSE))
expect_error(ggpredict(m1, "x", ppd = FALSE))
expect_s3_class(ggpredict(m2, ppd = FALSE), "ggalleffects")
expect_s3_class(ggpredict(m2, "x", ppd = FALSE), "data.frame")
expect_s3_class(suppressWarnings(ggpredict(m1, interval = "prediction")), "ggalleffects")
expect_s3_class(suppressWarnings(ggpredict(m1, "x", interval = "prediction")), "data.frame")
expect_s3_class(suppressWarnings(ggpredict(m2, interval = "prediction")), "ggalleffects")
expect_s3_class(suppressWarnings(ggpredict(m2, "x", interval = "prediction")), "data.frame")
expect_error(ggpredict(m1, interval = "confidence"))
expect_error(ggpredict(m1, "x", interval = "confidence"))
expect_s3_class(ggpredict(m2, interval = "confidence"), "ggalleffects")
expect_s3_class(ggpredict(m2, "x", interval = "confidence"), "data.frame")

set.seed(123)
out1 <- suppressWarnings(ggpredict(m1, "x", ppd = TRUE))
out1 <- suppressWarnings(ggpredict(m1, "x", interval = "prediction"))
set.seed(123)
out2 <- suppressWarnings(ggpredict(m1, "x", interval = "prediction"))
expect_equal(out1$predicted, out2$predicted, tolerance = 1e-3)
Expand Down

0 comments on commit bbf30f9

Please sign in to comment.