Skip to content

Commit

Permalink
Make snapshots smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
willgearty committed Sep 4, 2024
1 parent bcd519c commit 6327719
Show file tree
Hide file tree
Showing 5 changed files with 259 additions and 1,584 deletions.
2 changes: 2 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
In response to a request by CRAN, I have reduced the size of some of the test snapshots to reduce the overall tarball size.

## Test environments (with Github Actions)

* Windows 10.0.20348 (x86_64-w64-mingw32): R 4.4.1
Expand Down
608 changes: 83 additions & 525 deletions tests/testthat/_snaps/add_phylopic/phylopics-on-top-of-plot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
608 changes: 83 additions & 525 deletions tests/testthat/_snaps/add_phylopic/phylopics-with-widths.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 8 additions & 9 deletions tests/testthat/test-add_phylopic.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,23 @@ test_that("add_phylopic works", {

# a bunch of little colored phylopics, with existing image
set.seed(1234)
posx <- runif(50, 0, 10)
posy <- runif(50, 0, 10)
sizey <- runif(50, 0.4, 2)
angle <- runif(50, 0, 360)
hor <- sample(c(TRUE, FALSE), 50, TRUE)
ver <- sample(c(TRUE, FALSE), 50, TRUE)
fills <- sample(c("black", "darkorange", "grey42", "white"), 50,
posx <- runif(10, 0, 10)
posy <- runif(10, 0, 10)
sizey <- runif(10, 0.4, 2)
angle <- runif(10, 0, 360)
hor <- sample(c(TRUE, FALSE), 10, TRUE)
ver <- sample(c(TRUE, FALSE), 10, TRUE)
fills <- sample(c("black", "darkorange", "grey42", "white"), 10,
replace = TRUE)
cols <- ifelse(fills == "white", "black", NA)
alpha <- runif(50, 0, 1)
alpha <- runif(10, 0, 1)

p <- ggplot(data.frame(cat.x = posx, cat.y = posy), aes(cat.x, cat.y)) +
geom_blank() +
add_phylopic(uuid = "23cd6aa4-9587-4a2e-8e26-de42885004c9",
x = posx, y = posy, height = sizey,
fill = fills, color = cols, alpha = alpha,
angle = angle, horizontal = hor, vertical = ver)
p <- p + ggtitle("R Cat Herd!!")
expect_doppelganger("phylopics on top of plot", p)

p <- ggplot(data.frame(cat.x = posx, cat.y = posy), aes(cat.x, cat.y)) +
Expand Down

0 comments on commit 6327719

Please sign in to comment.