Skip to content

Commit 85160df

Browse files
authored
Merge pull request #1570 from exploratory-io/fix/oracle-client-location-windows-path-test
test(oracle): compare resolveOracleClientLocation home with separators neutralized
2 parents 856da62 + 5a36abe commit 85160df

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/testthat/test_system.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,9 +1282,13 @@ test_that("resolveOracleClientLocation only reports an ORACLE_HOME for the lib s
12821282
file.create(file.path(zipLayout, "libclntsh.dylib.23.1"))
12831283

12841284
# ROracle only ever looks at $ORACLE_HOME/lib, so home is the parent of the lib directory.
1285+
# resolveOracleClientLocation derives home with dirname(), which on Windows rewrites every
1286+
# separator to a forward slash, while tempfile() hands back backslashes -- so compare with the
1287+
# separators neutralized rather than against the raw homeLayout string. (no-op on Mac/Linux)
1288+
forwardSlashes <- function(p) gsub("\\\\", "/", p)
12851289
resolved <- exploratory:::resolveOracleClientLocation(homeLayout)
12861290
expect_equal(resolved$libDir, file.path(homeLayout, "lib"))
1287-
expect_equal(resolved$home, homeLayout)
1291+
expect_equal(forwardSlashes(resolved$home), forwardSlashes(homeLayout))
12881292

12891293
# The zip layout cannot be expressed as an ORACLE_HOME, so home stays empty and the
12901294
# caller falls back to loading the library directly.

0 commit comments

Comments
 (0)