diff --git a/DESCRIPTION b/DESCRIPTION index ed40095..83c8fcf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: gridtext Type: Package Title: Improved Text Rendering Support for 'Grid' Graphics -Version: 0.1.3 +Version: 0.1.4 Authors@R: person( given = "Claus O.", diff --git a/NEWS.md b/NEWS.md index 2290047..2105fe3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# gridtext 0.1.4 + +- Make sure tests don't fail if vdiffr is missing. + # gridtext 0.1.3 - Remove unneeded systemfonts dependency. diff --git a/cran-comments.md b/cran-comments.md index e49d025..442de1a 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,6 +1,4 @@ -Remove unnecessary dependency on systemfonts, per request by Brian Ripley: - -"Version 0.1.2 has added a requirement of package systemfonts. The latter is not easy to install because of its (mis-stated) system requirements. Clearly systemfonts is not needed for all the package users of gridtext as 0.1.1 sufficed, so it should be in Suggests and used conditionally. Please do so ASAP." +Make sure tests don't fail just because vdiffr couldn't be installed, per request by Brian Ripley. ## Test environments * ubuntu 20.04, devel and release diff --git a/tests/testthat/test-grid-renderer.R b/tests/testthat/test-grid-renderer.R index aa9ebbb..9c51f21 100644 --- a/tests/testthat/test-grid-renderer.R +++ b/tests/testthat/test-grid-renderer.R @@ -77,14 +77,14 @@ test_that("visual tests", { grid_renderer_text(r, "red bold", 20, 380, gp = gpar(col = "red", fontsize = 12, fontface = "bold")) grid_renderer_text(r, "roman", 30, 360, gp = gpar(fontsize = 12, fontfamily = "Times")) g <- grid_renderer_collect_grobs(r) - vdiffr::expect_doppelganger("Text in different stylings", draw_grob(g)) + expect_doppelganger("Text in different stylings", draw_grob(g)) grid_renderer_rect(r, 100, 400, 200, 20, gp = gpar(col = "blue")) grid_renderer_rect(r, 100, 200, 300, 30, gp = gpar(fill = "cornsilk"), r = 8) grid_renderer_text(r, "text 1, square box blue", 100, 400, gp = gpar(fontsize = 20)) grid_renderer_text(r, "text 2, rounded box filled", 100, 200, gp = gpar(fontsize = 20)) g <- grid_renderer_collect_grobs(r) - vdiffr::expect_doppelganger("Mixing text and boxes", draw_grob(g)) + expect_doppelganger("Mixing text and boxes", draw_grob(g)) logo_file <- system.file("extdata", "Rlogo.png", package = "gridtext") logo <- png::readPNG(logo_file, native = TRUE) @@ -92,7 +92,7 @@ test_that("visual tests", { height <- nrow(logo) grid_renderer_raster(r, logo, 10, 10, width, height) g <- grid_renderer_collect_grobs(r) - vdiffr::expect_doppelganger("Rendering raster data", draw_grob(g)) + expect_doppelganger("Rendering raster data", draw_grob(g)) }) diff --git a/tests/testthat/test-richtext-grob.R b/tests/testthat/test-richtext-grob.R index 017f340..e9a1efe 100644 --- a/tests/testthat/test-richtext-grob.R +++ b/tests/testthat/test-richtext-grob.R @@ -117,7 +117,7 @@ test_that("visual tests", { } } - vdiffr::expect_doppelganger("Various text boxes", draw_labels()) + expect_doppelganger("Various text boxes", draw_labels()) draw_labels_debug <- function() { function() { @@ -147,7 +147,7 @@ test_that("visual tests", { } } - vdiffr::expect_doppelganger("Various text boxes w/ debug", draw_labels_debug()) + expect_doppelganger("Various text boxes w/ debug", draw_labels_debug()) draw_aligned_heights <- function() { function() { @@ -179,7 +179,7 @@ test_that("visual tests", { } } - vdiffr::expect_doppelganger("Aligned heights", draw_aligned_heights()) + expect_doppelganger("Aligned heights", draw_aligned_heights()) draw_aligned_widths <- function() { function() { @@ -211,6 +211,6 @@ test_that("visual tests", { } } - vdiffr::expect_doppelganger("Aligned widths", draw_aligned_widths()) + expect_doppelganger("Aligned widths", draw_aligned_widths()) }) diff --git a/tests/testthat/test-textbox-grob.R b/tests/testthat/test-textbox-grob.R index b646c31..beaf613 100644 --- a/tests/testthat/test-textbox-grob.R +++ b/tests/testthat/test-textbox-grob.R @@ -31,7 +31,7 @@ test_that("visual tests", { } } - vdiffr::expect_doppelganger("Box spanning entire viewport, with margins", draw_box()) + expect_doppelganger("Box spanning entire viewport, with margins", draw_box()) draw_align_upright <- function() { function() { @@ -75,7 +75,7 @@ test_that("visual tests", { } } - vdiffr::expect_doppelganger("Multiple boxes, internal alignment", draw_align_upright()) + expect_doppelganger("Multiple boxes, internal alignment", draw_align_upright()) draw_align_left_rotated <- function() { @@ -124,7 +124,7 @@ test_that("visual tests", { } } - vdiffr::expect_doppelganger("Multiple boxes left rotated, internal alignment", draw_align_left_rotated()) + expect_doppelganger("Multiple boxes left rotated, internal alignment", draw_align_left_rotated()) draw_align_right_rotated <- function() { @@ -173,7 +173,7 @@ test_that("visual tests", { } } - vdiffr::expect_doppelganger("Multiple boxes right rotated, internal alignment", draw_align_right_rotated()) + expect_doppelganger("Multiple boxes right rotated, internal alignment", draw_align_right_rotated()) draw_align_inverted <- function() { @@ -221,7 +221,7 @@ test_that("visual tests", { invisible() } } - vdiffr::expect_doppelganger("Multiple boxes inverted, internal alignment", draw_align_inverted()) + expect_doppelganger("Multiple boxes inverted, internal alignment", draw_align_inverted()) draw_rotated_fixedpoint <- function() { function() { @@ -273,6 +273,6 @@ test_that("visual tests", { invisible() } } - vdiffr::expect_doppelganger("Rotation around fixed point", draw_rotated_fixedpoint()) + expect_doppelganger("Rotation around fixed point", draw_rotated_fixedpoint()) })