Skip to content

Commit

Permalink
test: remove tests for deprecated args and funs
Browse files Browse the repository at this point in the history
  • Loading branch information
rCarto committed Jan 9, 2025
1 parent 695828a commit f2d7261
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 29 deletions.
1 change: 0 additions & 1 deletion inst/tinytest/test_arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
10 changes: 0 additions & 10 deletions inst/tinytest/test_export.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
mtq <- mf_get_mtq()

library(tinytest)


expect_silent(mf_export(mtq, height = 600,
filename = paste0(tempfile(), ".png")))
dev.off()
Expand All @@ -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()
Expand All @@ -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()
1 change: 0 additions & 1 deletion inst/tinytest/test_init.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
15 changes: 0 additions & 15 deletions inst/tinytest/test_legend.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
3 changes: 1 addition & 2 deletions inst/tinytest/test_scale.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand All @@ -26,3 +24,4 @@ mf_map(mtqy)
expect_message(mf_scale(x = mtqy))
st_crs(mtqy) <- NA_crs_
expect_message(mf_scale(x = mtqy))

0 comments on commit f2d7261

Please sign in to comment.