Skip to content

Commit 598055a

Browse files
committed
Expect apply to refuse a bumped Go version
The vendor suite pinned apply exiting 0 when go.mod requires a newer version than the patch, though the replace it wrote was ignored. It now expects the refusal that names the selected version (#392); apply --check still reports the drift. Assisted-by: Claude Code:claude-opus-5-5
1 parent 3add9b2 commit 598055a

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

‎crates/socket-patch-cli/tests/vendor/e2e_golang_redirect.rs‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,18 @@ fn check_detects_resolved_version_mismatch() {
253253
);
254254

255255
// apply must NOT silently paper over it: a version bump means the manifest
256-
// is stale (it patches v1.4.2, the build wants v1.5.0). apply re-affirms the
257-
// v1.4.2 redirect but cannot make the build use it, so check STAYS red until
258-
// a human re-scans. (Fail-closed stays closed — never a false "in sync".)
256+
// is stale (it patches v1.4.2, the build wants v1.5.0). A v1.4.2 redirect
257+
// can't make the build use it, so apply refuses and names the selected
258+
// version (#392) instead of reporting the patch applied, and check STAYS
259+
// red until a human re-scans. (Fail-closed stays closed.)
260+
let (code, so, se) = apply(root, &gomodcache);
259261
assert_eq!(
260-
apply(root, &gomodcache).0,
261-
0,
262-
"apply itself succeeds (re-affirms v1.4.2)"
262+
code, 1,
263+
"apply must refuse an unselected version.\n{so}\n{se}"
264+
);
265+
assert!(
266+
format!("{so}{se}").contains("v1.5.0"),
267+
"the refusal names the version the build selects.\n{so}\n{se}"
263268
);
264269
assert_eq!(
265270
check(root, &gomodcache),

0 commit comments

Comments
 (0)