Skip to content

Commit

Permalink
Make ready for CRAN submission
Browse files Browse the repository at this point in the history
Version and tests for code from ggplot2 3.5.x
  • Loading branch information
aphalo committed Nov 7, 2023
1 parent cdddfe1 commit 62e1685
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: ggpp
Type: Package
Title: Grammar Extensions to 'ggplot2'
Version: 0.5.4.9010
Date: 2023-11-06
Version: 0.5.5
Date: 2023-11-07
Authors@R:
c(
person("Pedro J.", "Aphalo", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-3385-972X")),
Expand Down
4 changes: 2 additions & 2 deletions build-binary-from-source.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cd ..
R CMD INSTALL --build ggpextra_0.4.0.tar.gz
cd ./ggpmisc
R CMD INSTALL --build ggpp_0.5.4.9010.tar.gz
cd ./ggpp
20 changes: 20 additions & 0 deletions tests/testthat/test-margins.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
test_that("justify_grobs() checks input", {
expect_error(justify_grobs(1))
})

test_that("justify_grobs() passes input", {
expect_no_error(justify_grobs(grid::nullGrob()))
expect_no_error(justify_grobs(grid::nullGrob(), debug = TRUE))
})

test_that("rotate_just() accepts NULL", {
expect_no_error(rotate_just(NULL, 0.5, 0.5))
})

test_that("rotate_just() works as expected", {
expect_equal(rotate_just(NULL, 1, 1), list(hjust = 1, vjust = 1))
expect_equal(rotate_just(45, 1, 1), list(hjust = 1, vjust = 1))
expect_equal(rotate_just(135, 1, 1), list(hjust = 0, vjust = 1))
expect_equal(rotate_just(225, 1, 1), list(hjust = 0, vjust = 0))
expect_equal(rotate_just(315, 1, 1), list(hjust = 1, vjust = 0))
})

0 comments on commit 62e1685

Please sign in to comment.