Skip to content

Commit

Permalink
More robust path comparisons in the tests to pass CHECK on other plat…
Browse files Browse the repository at this point in the history
…forms.
  • Loading branch information
LTLA committed Jan 23, 2025
1 parent 75ec703 commit f42ded8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: alabaster.base
Title: Save Bioconductor Objects to File
Version: 1.7.3
Date: 2025-01-19
Version: 1.7.4
Date: 2025-01-23
Authors@R: person("Aaron", "Lun", role=c("aut", "cre"), email="[email protected]")
License: MIT + file LICENSE
Description:
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-cloneDirectory.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test_that("cloneDirectory symlinks are absolute", {
expect_identical(readLines(file.path(dest, "stuff", "whee.txt")), as.character(1:10))
expect_identical(readLines(file.path(dest, "stuff", "blah", "kanon.txt")), "air")

cleaned <- absolutizePath(src)
cleaned <- file.path(absolutizePath(getwd()), basename(src)) # need to clean the path for a valid comparison.
expect_identical(Sys.readlink(file.path(dest, "foobar.txt")), file.path(cleaned, "foobar.txt"))
expect_identical(Sys.readlink(file.path(dest, "stuff", "whee.txt")), file.path(cleaned, "stuff", "whee.txt"))
expect_identical(Sys.readlink(file.path(dest, "stuff", "blah", "kanon.txt")), file.path(cleaned, "stuff", "blah", "kanon.txt"))
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-createDedupSession.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_that("deduplication utilities work as expected", {
tmp <- tempfile()
dir.create(tmp)
addObjectToDedupSession(y, session, tmp)
expect_identical(checkObjectInDedupSession(y, session), tmp)
expect_identical(checkObjectInDedupSession(y, session), absolutizePath(tmp)) # need to clean the path for a valid comparison.

# Doesn't respond this way for different objects.
z <- y
Expand All @@ -21,8 +21,8 @@ test_that("deduplication utilities work as expected", {
tmp2 <- tempfile()
dir.create(tmp2)
addObjectToDedupSession(z, session, tmp2)
expect_identical(checkObjectInDedupSession(y, session), tmp)
expect_identical(checkObjectInDedupSession(z, session), tmp2)
expect_identical(checkObjectInDedupSession(y, session), absolutizePath(tmp))
expect_identical(checkObjectInDedupSession(z, session), absolutizePath(tmp2))

# Doesn't respond this way for a different session.
session2 <- createDedupSession()
Expand Down

0 comments on commit f42ded8

Please sign in to comment.