Skip to content

Commit

Permalink
Fix test for varying versions of dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
willgearty committed Oct 9, 2023
1 parent f02a9ab commit 43637f8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/testthat/test-phylopic_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ test_that("recolor_phylopic works", {
cat <- get_phylopic("23cd6aa4-9587-4a2e-8e26-de42885004c9")
cat_recolor <- recolor_phylopic(cat, .5, color = "green", fill = "red")
expect_true(is(cat_recolor, "Picture"))
expect_equal(cat_recolor@content[[1]]@gp$col, "green")
expect_equal(cat_recolor@content[[1]]@gp$fill, "red")
expect_equal(cat_recolor@content[[1]]@gp$alpha, .5)
if ("content" %in% slotNames(cat_recolor@content[[1]])) {
expect_equal(cat_recolor@content[[1]]@content[[1]]@gp$col, "green")
expect_equal(cat_recolor@content[[1]]@content[[1]]@gp$fill, "red")
expect_equal(cat_recolor@content[[1]]@content[[1]]@gp$alpha, .5)
} else {
expect_equal(cat_recolor@content[[1]]@gp$col, "green")
expect_equal(cat_recolor@content[[1]]@gp$fill, "red")
expect_equal(cat_recolor@content[[1]]@gp$alpha, .5)
}

cat_png <- get_phylopic("23cd6aa4-9587-4a2e-8e26-de42885004c9",
format = "raster")
Expand Down

0 comments on commit 43637f8

Please sign in to comment.