Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Sep 20, 2024
1 parent 3c17dc9 commit 6ad4e02
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/testthat/test-layer.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,22 @@ test_that("layer names can be resolved", {
)
})

test_that("check_subclass can resolve classes via constructors", {

env <- new_environment(list(
geom_foobar = geom_point,
stat_foobar = stat_boxplot,
position_foobar = position_nudge,
guide_foobar = guide_axis_theta
))

expect_s3_class(check_subclass("foobar", "Geom", env = env), "GeomPoint")
expect_s3_class(check_subclass("foobar", "Stat", env = env), "StatBoxplot")
expect_s3_class(check_subclass("foobar", "Position", env = env), "PositionNudge")
expect_s3_class(check_subclass("foobar", "Guide", env = env), "GuideAxisTheta")

})


# Data extraction ---------------------------------------------------------

Expand Down

0 comments on commit 6ad4e02

Please sign in to comment.