From 7809ff818a0939d267f1c654d2c6e9f0fe7af25c Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Fri, 30 Oct 2026 17:26:22 -0600 Subject: [PATCH] test(viewer): the found book's expected path drops Windows' extended-length prefix P11c run 15: Windows reached the viewer's tests; the expectation came from `canonicalize`, which spells `\\?\C:\...` there, while the books never keep that prefix. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp --- crates/ledger-gui/tests/exports.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/ledger-gui/tests/exports.rs b/crates/ledger-gui/tests/exports.rs index 2110738..c536067 100644 --- a/crates/ledger-gui/tests/exports.rs +++ b/crates/ledger-gui/tests/exports.rs @@ -387,10 +387,16 @@ fn the_viewer_finds_its_book_in_the_root() { .unwrap(); } // As the system spells it: `book_in_root` answers a canonical path - // (macOS writes /tmp as /private/tmp). + // (macOS writes /tmp as /private/tmp), with no Windows `\\?\` prefix + // (the books never keep one). let dir = |id: &str| { - std::fs::canonicalize(root.book_dir(&ledger_store::root::BookId::parse(id).unwrap())) - .unwrap() + let p = + std::fs::canonicalize(root.book_dir(&ledger_store::root::BookId::parse(id).unwrap())) + .unwrap(); + match p.to_str().and_then(|s| s.strip_prefix(r"\\?\")) { + Some(plain) if cfg!(windows) => std::path::PathBuf::from(plain), + _ => p, + } }; assert_eq!( ledger_gui::book_in_root(Some(&r), Some("zeta")).unwrap(),