test(mcp): the tree digest names files with / on every system

handles_from_before_a_close_do_nothing_after_the_book_is_open_again adds the
planted stray file to the digest as uploads/stray.bin, but the walk keyed the
same file by the system's path, uploads\stray.bin on Windows, so the two
maps could never be equal there. The helper now keys with / everywhere; the
assertion (an old handle changes no file) is untouched.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 08:34:04 -07:00
1 parent e9dc03a44a
commit b9ef35592c
1 file changed
+7 -1
+7 -1
View File
@@ -5418,8 +5418,14 @@ mod tests {
if path.is_dir() {
walk(base, &path, out);
} else if let Ok(bytes) = std::fs::read(&path) {
// Keyed with `/` between parts on every system (the
// test names files so), not the system's separator.
out.insert(
path.strip_prefix(base).unwrap().display().to_string(),
path.strip_prefix(base)
.unwrap()
.display()
.to_string()
.replace('\\', "/"),
bytes,
);
}