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 <[email protected]>
This commit is contained in:
Brandon ThomasandClaude Opus 5.5 authored and GitHub committed 2026-10-09 15:32:39 -04:00
1 parent 8b29d6c2cd
commit ee3ebfa748
1 file changed
+2 -1
+2 -1
View File
@@ -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));