From 60798cdbc3960e25358fc31c4a7451df78d38968 Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Sat, 11 Oct 2025 10:40:23 +0200 Subject: [PATCH] radicle/profile: Canonicalize during test Fixes test `profile::test::canonicalize_home`. Since `Home::new` canonicalizes its argument (which is what the test wants to ensure), also canonicalize the expected value, which is especially important on Windows as the canonicalization is more complex than on Linux. For example: thread 'profile::test::canonicalize_home' panicked at crates\radicle\src\profile.rs:802:9: assertion `left == right` failed left: "C:\\Users\\runneradmin\\AppData\\Local\\Temp\\.tmpMnNkr6\\Home\\Radicle" right: "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\.tmpMnNkr6\\Home\\Radicle" --- crates/radicle/src/profile.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/radicle/src/profile.rs b/crates/radicle/src/profile.rs index cf3925c4..83ed1744 100644 --- a/crates/radicle/src/profile.rs +++ b/crates/radicle/src/profile.rs @@ -779,15 +779,16 @@ mod test { use super::*; // Checks that if we have: - // '/run/user/1000/.tmpqfK6ih/../.tmpqfK6ih/Radicle/Home' + // '/run/user/1000/.tmpqfK6ih/../.tmpqfK6ih/Home/Radicle' // // that it gets normalized to: - // '/run/user/1000/.tmpqfK6ih/Radicle/Home' + // '/run/user/1000/.tmpqfK6ih/Home/Radicle' #[test] fn canonicalize_home() { let tmp = tempfile::tempdir().unwrap(); let path = tmp.path().join("Home").join("Radicle"); fs::create_dir_all(path.clone()).unwrap(); + let path = dunce::canonicalize(path).unwrap(); let last = tmp.path().components().next_back().unwrap(); let home = Home::new(