Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Romain committed Feb 6, 2024
1 parent 693ddb2 commit 29cb72f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions tests/testthat/test-merges_spatial.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ test_that("merge_spatial preserve storage mode", {
})


test_that("merge_spatial works with SpatialPolygons", {
skip_if_not_installed("sp")
lakes <- as(sflakes, "SpatialPolygons")

las <- merge_spatial(las, lakes)
cn <- names(las)

expect_true("id" %in% cn)
expect_true(is.integer(las$id))
expect_equivalent(as.numeric(table(las$id)), c(216))
})
# test_that("merge_spatial works with SpatialPolygons", {
# skip_if_not_installed("sp")
# lakes <- as(sflakes, "SpatialPolygons")
#
# las <- merge_spatial(las, lakes)
# cn <- names(las)
#
# expect_true("id" %in% cn)
# expect_true(is.integer(las$id))
# expect_equivalent(as.numeric(table(las$id)), c(216))
# })

test_that("merge_spatial works with sfc", {

Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-roughness.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ test_that("Flat surfaces have a rumple index of 1. Delaunay method", {
})

test_that("Flat surfaces have a rumple index of 1. Jenness method", {
skip("No longeur using sp")
bbox = raster::extent(0,10,0,10)
r = raster::raster(bbox, res = 0.5)
skip_if_not_installed("sp")
bbox = terra::ext(0,10,0,10)
r = terra::rast(bbox, res = 0.5)
r[] = 2.56

expect_equal(rumple_index(r), 1)
Expand Down

0 comments on commit 29cb72f

Please sign in to comment.