fix(store): no root keeps the \\?\ prefix; the Windows root test compares canonical homes (P11c)
main's canonical default made Root::setup take std::fs::canonicalize(home), which on Windows is \\?\C:\... with the long name. root.rs now uses root::canonical (canonicalize, then the prefix off) at every site, so no root, record or message keeps the prefix; Unix is unchanged (the identity), and macOS still agrees on /tmp and /private/tmp. windows_root.rs compares against default_root(canonical(home)), so TEMP's 8.3 short name is not in the expectation, and asserts the root has no prefix. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
1 parent
4a1bd05b7c
commit
f2d1d4e892
2 files changed
+20
-10
No files matched your search
@@ -35,7 +35,11 @@ fn the_default_root_sits_under_local_app_data() {
|
||||
fn setup_makes_a_private_root_and_its_folders() {
|
||||
let home = tmp("setup");
|
||||
let (root, report) = Root::setup(home.path(), None, None).unwrap();
|
||||
assert_eq!(root.path(), default_root(home.path()));
|
||||
// The default root of the home as the system names it (its long name,
|
||||
// no `\\?\` prefix; TEMP may hold an 8.3 short name).
|
||||
let real_home = ledger_store::root::canonical(home.path()).unwrap();
|
||||
assert_eq!(root.path(), default_root(&real_home));
|
||||
assert!(!root.path().to_string_lossy().starts_with(r"\\?\"));
|
||||
assert!(report.created && !report.tightened && !report.recorded);
|
||||
assert!(winsec::is_private(root.path()).unwrap());
|
||||
for sub in ["books", "run", "legacy"] {
|
||||
|
||||
Reference in new issue
Block a user