Skip to content

Commit 5a36abe

Browse files
hidekojiclaude
andcommitted
test(oracle): compare resolveOracleClientLocation home with separators neutralized
The Windows daily test failed on test_system.R:1287: Expected 'resolved$home' to equal 'homeLayout'. x[1]: "C:/Users/.../file18b41bfa68e1/client64" y[1]: "C:\\Users\\...\\file18b41bfa68e1/client64" Test-only bug, not a production one. On Windows tempfile() returns backslashes, file.path() appends with a forward slash, so homeLayout is a MIXED-separator string. resolveOracleClientLocation derives home via dirname(), and dirname() on Windows rewrites every separator to a forward slash -- so the two strings describe the same directory but can never be identical() there. Mac/Linux never see it because tempfile() already returns forward slashes. Compare with the separators neutralized instead (a no-op on Mac/Linux). The assertion still pins that home is the parent of the lib directory -- the zip layout's home == "" case and the libDir assertion are untouched. Verified on the Windows daily-test box (exp-test1) against the installed package: identical() is FALSE pre-fix and TRUE post-fix; full test_system.R still passes on Mac ARM. No DESCRIPTION bump: tests only, no shipped R code change, so no rebuilt binaries are required. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent fe4e304 commit 5a36abe

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)