From b3e8e4c756e4c2d0d6ee65fb3f92b959c0af35ef Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 06:29:46 +0000 Subject: [PATCH 1/2] Fix Windows nightly yarnrc test path expectation The nightly Windows `test` leg has been red since #1696 added global_folder_values_read_like_yarn. Its escaped-expression case expected `/w/\${HOME}/x`, which only holds on Unix. On Windows a leading `\` is root-relative, so joining it onto the cwd replaces the cwd's root (as Node's path.resolve does) and gives `\${HOME}/x`. The test now expects the platform's join result. No product change. Refs #1689 Assisted-by: Claude Code:claude-opus-5-5 --- .../src/patch/redirect/yarnrc_tests.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/socket-patch-core/src/patch/redirect/yarnrc_tests.rs b/crates/socket-patch-core/src/patch/redirect/yarnrc_tests.rs index b39393c0c..4c857bd7d 100644 --- a/crates/socket-patch-core/src/patch/redirect/yarnrc_tests.rs +++ b/crates/socket-patch-core/src/patch/redirect/yarnrc_tests.rs @@ -586,16 +586,18 @@ fn global_folder_values_read_like_yarn() { Vec::::new() ); // An escaped expression stays verbatim (`ini` reads `\\` as `\` - // first). + // first). On Windows the leading `\` makes it root-relative, so it + // replaces the cwd's root as `path.resolve` does. + let escaped = if cfg!(windows) { + "\\${HOME}/x" + } else { + "/w/\\${HOME}/x" + }; for text in [ "global-folder=\\${HOME}/x\n", "global-folder=\\\\${HOME}/x\n", ] { - assert_eq!( - npmrc(Host::new(), text), - paths(&["/w/\\${HOME}/x"]), - "{text:?}" - ); + assert_eq!(npmrc(Host::new(), text), paths(&[escaped]), "{text:?}"); } // `ini` ends an unquoted value at a comment and unquotes a quoted one. assert_eq!( From 50f5840145d80303a4944493f16dc9493df15762 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 06:55:37 +0000 Subject: [PATCH 2/2] Correct Windows root-relative join comment Windows keeps the cwd's drive and replaces only the path below it; the comment said the root was replaced. Assisted-by: Claude Code:claude-opus-5-5 --- crates/socket-patch-core/src/patch/redirect/yarnrc_tests.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/socket-patch-core/src/patch/redirect/yarnrc_tests.rs b/crates/socket-patch-core/src/patch/redirect/yarnrc_tests.rs index 4c857bd7d..6e975243d 100644 --- a/crates/socket-patch-core/src/patch/redirect/yarnrc_tests.rs +++ b/crates/socket-patch-core/src/patch/redirect/yarnrc_tests.rs @@ -586,8 +586,9 @@ fn global_folder_values_read_like_yarn() { Vec::::new() ); // An escaped expression stays verbatim (`ini` reads `\\` as `\` - // first). On Windows the leading `\` makes it root-relative, so it - // replaces the cwd's root as `path.resolve` does. + // first). On Windows the leading `\` makes it root-relative: it keeps + // the cwd's drive and replaces the rest, as `path.resolve` does + // (`/w` has no drive, so nothing of it is kept). let escaped = if cfg!(windows) { "\\${HOME}/x" } else {