From 2c60fe5a68f40db943b25b42c0cd95a9f9d64a0c Mon Sep 17 00:00:00 2001 From: Jindra Lacko Date: Fri, 5 May 2023 12:33:33 +0200 Subject: [PATCH] fixes #75 (#76) --- tests/testthat/test-1-relief.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/testthat/test-1-relief.R b/tests/testthat/test-1-relief.R index 68e411a..1928807 100644 --- a/tests/testthat/test-1-relief.R +++ b/tests/testthat/test-1-relief.R @@ -17,14 +17,14 @@ test_that("reliéf", { expect_s4_class(vyskopis("rayshaded", FALSE), "SpatRaster") # test rozsahu - expect_equal(terra::expanse(vyskopis()), units::drop_units(st_area(republika("low"))), tolerance = 1/100) - expect_equal(terra::expanse(vyskopis("actual")), units::drop_units(st_area(republika("low"))), tolerance = 1/100) - expect_equal(terra::expanse(vyskopis("rayshaded")), units::drop_units(st_area(republika("low"))), tolerance = 1/100) + expect_equal(terra::expanse(vyskopis())$area, units::drop_units(st_area(republika("low"))), tolerance = 1/100) + expect_equal(terra::expanse(vyskopis("actual"))$area, units::drop_units(st_area(republika("low"))), tolerance = 1/100) + expect_equal(terra::expanse(vyskopis("rayshaded"))$area, units::drop_units(st_area(republika("low"))), tolerance = 1/100) # oříznutý raster je menší než surový - expect_gt(terra::expanse(vyskopis(cropped = F)), terra::expanse(vyskopis(cropped = T))) - expect_gt(terra::expanse(vyskopis("rayshaded", cropped = F)), terra::expanse(vyskopis("rayshaded", cropped = T))) - expect_gt(terra::expanse(vyskopis("actual", cropped = F)), terra::expanse(vyskopis("actual", cropped = T))) + expect_gt(terra::expanse(vyskopis(cropped = F))$area, terra::expanse(vyskopis(cropped = T))$area) + expect_gt(terra::expanse(vyskopis("rayshaded", cropped = F))$area, terra::expanse(vyskopis("rayshaded", cropped = T))$area) + expect_gt(terra::expanse(vyskopis("actual", cropped = F))$area, terra::expanse(vyskopis("actual", cropped = T))$area) # test projekce - WGS84 pure & unadultered expect_true(grepl("WGS 84", st_crs(vyskopis())$input))