Skip to content

Commit

Permalink
fix: use normalzePath for path comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
jorainer committed May 17, 2024
1 parent 44050a0 commit 05f5e8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/testthat/test_MsBackendMzR.R
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,9 @@ test_that("dataStorageBasePath,dataStorageBasePath<-,MsBackendMzR works", {
MsCoreUtils::common_path(sciex_file))
tmp <- sciex_mzr
dataStorageBasePath(tmp) <- tmpd
expect_equal(dataStorageBasePath(tmp), gsub("\\", "/", tmpd, fixed = TRUE))
expect_true(validObject(tmp))
bp <- normalizePath(dataStorageBasePath(tmp))
expect_equal(bp, tmpd)

#' errors
expect_error(dataStorageBasePath(tmp) <- "some path", "Provided path")
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test_Spectra.R
Original file line number Diff line number Diff line change
Expand Up @@ -1901,7 +1901,9 @@ test_that("dataStorageBasePath,dataStorageBasePath<-,MsBackendMzR works", {
tmp <- sciex_mzr
tmp <- Spectra(tmp)
dataStorageBasePath(tmp) <- tmpd
expect_equal(dataStorageBasePath(tmp), tmpd)
expect_true(validObject(tmp@backend))
bp <- normalizePath(dataStorageBasePath(tmp))
expect_equal(bp, tmpd)

#' errors
expect_error(dataStorageBasePath(tmp) <- "some path", "Provided path")
Expand Down

0 comments on commit 05f5e8b

Please sign in to comment.