From f2d7261fc8f66a0b88ae02e75ca98dd11a68a17c Mon Sep 17 00:00:00 2001 From: rCarto Date: Thu, 9 Jan 2025 15:12:09 +0100 Subject: [PATCH] test: remove tests for deprecated args and funs --- inst/tinytest/test_arrow.R | 1 - inst/tinytest/test_export.R | 10 ---------- inst/tinytest/test_init.R | 1 - inst/tinytest/test_legend.R | 15 --------------- inst/tinytest/test_scale.R | 3 +-- 5 files changed, 1 insertion(+), 29 deletions(-) diff --git a/inst/tinytest/test_arrow.R b/inst/tinytest/test_arrow.R index a458e587..792f1673 100644 --- a/inst/tinytest/test_arrow.R +++ b/inst/tinytest/test_arrow.R @@ -7,5 +7,4 @@ for (i in list("topleft", "top", "topright", "right", "bottomright", "bottom", "bottomleft", "left", c(701012.7, 1613554))){ expect_silent(mf_arrow(pos = i, col = "red")) } -expect_warning(mf_arrow(pos = i + c(10000, 10000), adjust = mtq)) expect_silent(mf_arrow(pos = "top", adj = c(-5, 0), cex = 2)) diff --git a/inst/tinytest/test_export.R b/inst/tinytest/test_export.R index 2881aaab..1bb73aa5 100644 --- a/inst/tinytest/test_export.R +++ b/inst/tinytest/test_export.R @@ -1,8 +1,5 @@ mtq <- mf_get_mtq() -library(tinytest) - - expect_silent(mf_export(mtq, height = 600, filename = paste0(tempfile(), ".png"))) dev.off() @@ -16,9 +13,6 @@ dev.off() expect_silent(mf_export(mtq, filename = paste0(tempfile(), ".svg"), width = 6, height = 6)) dev.off() -expect_warning(mf_export(mtq, theme = "darkula", - filename = paste0(tempfile(), ".svg"))) -dev.off() expect_silent(mf_export(mtq, filename = paste0(tempfile(), ".svg"))) dev.off() @@ -37,10 +31,6 @@ expect_silent(mf_export(r)) mf_raster(r, add = TRUE) dev.off() -expect_message(mf_export(mtq, height = 600, export = "png", - filename = paste0(tempfile(), ".png"))) -dev.off() - expect_silent(mf_export(st_transform(mtq, "epsg:4326"), filename = paste0(tempfile(), ".png"))) dev.off() diff --git a/inst/tinytest/test_init.R b/inst/tinytest/test_init.R index 8362b339..d26e2372 100644 --- a/inst/tinytest/test_init.R +++ b/inst/tinytest/test_init.R @@ -2,7 +2,6 @@ mtq <- mf_get_mtq() expect_silent(mf_init(mtq)) expect_silent(mf_init(mtq, expandBB = c(0, 0, 0, .4))) -expect_warning(mf_init(mtq, theme = "darkula")) b <- terra::rast(system.file("ex/elev.tif", package = "terra")) expect_silent(mf_init(b)) mf_raster(b, add = TRUE) diff --git a/inst/tinytest/test_legend.R b/inst/tinytest/test_legend.R index c0cf5130..93ac978c 100644 --- a/inst/tinytest/test_legend.R +++ b/inst/tinytest/test_legend.R @@ -43,21 +43,6 @@ expect_silent(mf_legend(type = "prop_line", val = c(5, 50, 100), frame = TRUE)) - -## test deprecation -expect_message(mf_legend_c(val = c(1, 2, 3, 4), - pal = c("red1", "red3", "red4"))) -expect_message(mf_legend_t(val = c("type A", "type B"), - pal = c("navy", "tomato"))) -expect_message(mf_legend_gl(lwd = c(0.2, 2, 4, 5, 10), - val = c(1, 2, 3, 4, 10.2, 15.2))) -expect_message(mf_legend_s(val = c("Type C", "Type D"), - pal = c("cyan", "plum"), - pt_pch = c(21, 23), pt_cex = c(1, 2))) -expect_message(mf_legend_p(val = c(1, 20, 100), - col = "red", inches = .3)) -expect_message(mf_legend_pl(lwd = 20, val = c(5, 10, 50, 100))) - dev.off() expect_equal(mf_get_leg_pos(mtq, 1), "bottomleft") expect_equal(mf_get_leg_pos(mtq[1, ], 2), c("topleft", "top")) diff --git a/inst/tinytest/test_scale.R b/inst/tinytest/test_scale.R index 74ecd66e..5fe88baf 100644 --- a/inst/tinytest/test_scale.R +++ b/inst/tinytest/test_scale.R @@ -4,8 +4,6 @@ expect_silent(mf_scale(pos = c(713709.9, 1596117))) expect_silent(mf_scale()) expect_silent(mf_scale(pos = "bottomleft", size = 5)) -expect_message(mf_scale(pos = "bottomleft", size = 5000, unit = "ft")) - expect_error(mf_scale(crs_units = "pop")) expect_error(mf_scale(scale_units = "pop")) @@ -26,3 +24,4 @@ mf_map(mtqy) expect_message(mf_scale(x = mtqy)) st_crs(mtqy) <- NA_crs_ expect_message(mf_scale(x = mtqy)) +