Skip to content

Commit

Permalink
Merge pull request #303 from teunbrand/ggplot2_360
Browse files Browse the repository at this point in the history
Compatibility with ggplot2 3.6.0
  • Loading branch information
jhollway authored Feb 13, 2025
2 parents e779db5 + 647d858 commit 047bb51
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tests/testthat/test-model_tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ test_that("cug plot works", {
expect_s3_class(cugplot$layers[[1]], "ggproto")
expect_s3_class(cugplot$layers[[1]]$geom, "GeomDensity")
expect_s3_class(cugplot$layers[[1]]$stat, "StatDensity")
expect_identical(cugplot$labels$x, "Statistic")
expect_identical(cugplot$labels$y, "Density")
labels <- if ("get_labs" %in% getNamespaceExports("ggplot2")) {
ggplot2::get_labs(cugplot)
} else {
cugplot$labels
}
expect_identical(labels$x, "Statistic")
expect_identical(labels$y, "Density")
})

qapplot <- plot(qaptest)
Expand All @@ -70,6 +75,11 @@ test_that("qap plot works", {
expect_s3_class(qapplot$layers[[1]], "ggproto")
expect_s3_class(qapplot$layers[[1]]$geom, "GeomDensity")
expect_s3_class(qapplot$layers[[1]]$stat, "StatDensity")
expect_identical(qapplot$labels$x, "Statistic")
expect_identical(qapplot$labels$y, "Density")
labels <- if ("get_labs" %in% getNamespaceExports("ggplot2")) {
ggplot2::get_labs(cugplot)
} else {
cugplot$labels
}
expect_identical(labels$x, "Statistic")
expect_identical(labels$y, "Density")
})

0 comments on commit 047bb51

Please sign in to comment.