From ca9e4707d5a11182474c0ef3145846e6e41caa48 Mon Sep 17 00:00:00 2001 From: Lambda Moses Date: Fri, 8 Nov 2024 01:23:27 -0500 Subject: [PATCH] Deal with Mac and Windows test failures --- .github/workflows/R-CMD-check.yaml | 2 +- tests/testthat/test.R | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 7b0d4b5..9106c46 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -36,7 +36,7 @@ jobs: - uses: r-lib/actions/setup-pandoc@v2 - if: runner.os == 'macOS' - run: brew install apache-arrow fftw jpeg libtiff imagemagick + run: brew install apache-arrow fftw jpeg libtiff imagemagick pkg-config - name: Setup R and Bioconductor uses: grimbough/bioc-actions/setup-bioc@v1 diff --git a/tests/testthat/test.R b/tests/testthat/test.R index 70e01c5..08bf30a 100644 --- a/tests/testthat/test.R +++ b/tests/testthat/test.R @@ -95,7 +95,12 @@ test_that("Save and read single file BioFormatsImage", { expect_equal(transformation(bfi), transformation(bfi2)) origin <- SpatialFeatureExperiment::origin expect_equal(origin(bfi), origin(bfi2), ignore_attr = "names") - expect_equal(imgSource(bfi2), normalizePath(file.path(fsave, "image.ome.tif"))) + if (Sys.info()['sysname'] == "Windows") { + spl1 <- strsplit(imgSource(bfi2), "[(\\)/]")[[1]] + spl2 <- strsplit(normalizePath(file.path(fsave, "image.ome.tif")), "[(\\)/]")[[1]] + expect_equal(tail(spl1, 3), tail(spl2,3)) + } else + expect_equal(imgSource(bfi2), normalizePath(file.path(fsave, "image.ome.tif"))) unlink(fsave, recursive = TRUE) })