diff --git a/DESCRIPTION b/DESCRIPTION index eee31d4a3926e55b73eb1110361e05df1979535c..fe86337fb770253c053d24b15b7844d593226b38 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -51,3 +51,4 @@ LazyData: true SystemRequirements: cdo Encoding: UTF-8 RoxygenNote: 7.2.0 +Config/testthat/edition: 3 diff --git a/tests/testthat/_snaps/PlotEquiMap/PlotEquiMap_1a.png b/tests/testthat/_snaps/PlotEquiMap/PlotEquiMap_1a.png new file mode 100644 index 0000000000000000000000000000000000000000..99002e9d79255f4ee8bc19e33e8043837ff2c4ab Binary files /dev/null and b/tests/testthat/_snaps/PlotEquiMap/PlotEquiMap_1a.png differ diff --git a/tests/testthat/_snaps/PlotEquiMap/PlotEquiMap_1b.png b/tests/testthat/_snaps/PlotEquiMap/PlotEquiMap_1b.png new file mode 100644 index 0000000000000000000000000000000000000000..7cae6b5044d626384a76ab8115ebff3920d4e1f2 Binary files /dev/null and b/tests/testthat/_snaps/PlotEquiMap/PlotEquiMap_1b.png differ diff --git a/tests/testthat/test-PlotEquiMap.R b/tests/testthat/test-PlotEquiMap.R new file mode 100644 index 0000000000000000000000000000000000000000..a452308ff5cc6351f13d6a64e2277a7fec56e4f2 --- /dev/null +++ b/tests/testthat/test-PlotEquiMap.R @@ -0,0 +1,24 @@ +# PlotEquiMap +save_PlotEquiMap <- function(...) { + path <- tempfile(fileext = ".png") + do.call(PlotEquiMap, list(..., fileout = path)) + path +} + +test_that("1. 360x181", { + + set.seed(100) + data <- array(rep(seq(-10, 10, length.out = 181), 360) + rnorm(360), + dim = c(lat = 181, lon = 360)) + + expect_snapshot_file( + save_PlotEquiMap(data, lon = 0:359, lat = -90:90, filled.continents = F), + name = 'PlotEquiMap_1a.png' + ) + + expect_snapshot_file( + save_PlotEquiMap(data, lon = -180:179, lat = 90:-90, filled.continents = T, brks = seq(-13,13, 1), color_fun = clim.palette("purpleorange"), triangle_ends = c(T, T)), + name = 'PlotEquiMap_1b.png' + ) + +})