From ee3ebfa74864253f36261df43327edbe675352e8 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 9 Oct 2026 15:32:39 -0400 Subject: [PATCH] Smart contents test: match the refused path by file name (Windows CI red since #1882) (#2042) The refusal message Debug-quotes the path, which doubles backslashes on Windows, so contains(path) never matched there. Matching the unique file name keeps the check. Co-authored-by: Claude Opus 5.5 --- crates/engine/src/smart_cmds/tests.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/smart_cmds/tests.rs b/crates/engine/src/smart_cmds/tests.rs index 0253d551e2..915ad2d8ae 100644 --- a/crates/engine/src/smart_cmds/tests.rs +++ b/crates/engine/src/smart_cmds/tests.rs @@ -808,7 +808,8 @@ fn automation_smart_contents_refuses_disk_sources_before_changes() { let revision = s.active().unwrap().revision; let history = s.active().unwrap().history.entries().len(); let error = s.execute(cmd, json!({"layer": id})).unwrap_err().to_string(); - assert!(error.contains("source path refused") && error.contains(path.to_str().unwrap()), "{error}"); + // The error Debug-quotes the path (doubled backslashes on Windows), so match its file name. + assert!(error.contains("source path refused") && error.contains(path.file_name().unwrap().to_str().unwrap()), "{error}"); assert!(Arc::ptr_eq(&before, &s.active().unwrap().doc)); assert_eq!((s.documents().len(), s.active().unwrap().revision, s.active().unwrap().history.entries().len()), (1, revision, history));