diff --git a/tests/testthat/test-image.R b/tests/testthat/test-image.R index 587e7fe..f35a5b4 100644 --- a/tests/testthat/test-image.R +++ b/tests/testthat/test-image.R @@ -176,7 +176,7 @@ test_that("transposeImg, SpatRasterImage method", { expect_equal(d[2], 13) # Save to file - fn <- normalizePath(file.path(getwd(), "foo.tif")) + fn <- normalizePath(file.path(getwd(), "foo.tif"), mustWork = FALSE) img_t3 <- transposeImg(img, filename = fn) expect_equal(dim(img)[1:2], dim(img_t3)[2:1]) expect_equal(imgSource(img_t3), fn) @@ -200,7 +200,7 @@ test_that("mirrorImg, SpatRasterImage method", { expect_equal(imgRaster(img_m2)[10,3,2][[1]], 190) # Use filename - fn <- normalizePath(file.path(getwd(), "foo.tif")) + fn <- normalizePath(file.path(getwd(), "foo.tif"), mustWork = FALSE) img_m3 <- mirrorImg(img, filename = "foo.tif") expect_equal(imgSource(img_m3), fn) expect_true(file.exists(fn)) diff --git a/tests/testthat/test-subset.R b/tests/testthat/test-subset.R index 30b8b68..8ecebe9 100644 --- a/tests/testthat/test-subset.R +++ b/tests/testthat/test-subset.R @@ -134,7 +134,7 @@ inds <- c(rep(TRUE, ncol(sfe1)), not_singleton) test_that("Images are cropped after subsetting, multiple samples", { sfe3 <- sfe[,inds] - cg <- st_centroid(spotPoly(sfe3, sample_id = "all")) + cg <- st_centroid(st_geometry(spotPoly(sfe3, sample_id = "all"))) nCounts <- Matrix::colSums(counts(sfe3)) # For sample 1 img1 <- getImg(sfe3, sample_id = "ob") |> imgRaster()