Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggplot and grid fixes #452

Merged
merged 11 commits into from
Jul 6, 2024
Prev Previous commit
Next Next commit
add tests for simpleUnit
  • Loading branch information
moodymudskipper committed Jul 6, 2024
commit 7e930228bcb896c95760e08e915e182f13e0a668
16 changes: 16 additions & 0 deletions tests/testthat/_snaps/s3-ggplot2-simpleUnit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# simpleUnit

Code
construct(grid::unit(c(1L, 1L, 1L), "cm"))
Output
grid::unit(rep(1, 3L), units = "cm")
Code
construct_base(grid::unit(c(1L, 1L, 1L), "cm"))
Output
grid::unit(rep(1, 3L), units = "cm")
Code
construct_dput(grid::unit(c(1L, 1L, 1L), "cm"))
Output
rep(1, 3L) |>
structure(unit = 1L, class = c("simpleUnit", "unit", "unit_v2"))

7 changes: 7 additions & 0 deletions tests/testthat/test-s3-ggplot2-simpleUnit.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test_that("simpleUnit", {
expect_snapshot({
construct(grid::unit(c(1L,1L, 1L), "cm"))
construct_base(grid::unit(c(1L,1L, 1L), "cm"))
construct_dput(grid::unit(c(1L,1L, 1L), "cm"))
})
})