-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Depending on if a relative path starts with a "." or not, the same diff will give different results.
let path_a = PathBuf::new(r"a\b\c");
let path_a_with_dot = PathBuf::new(r".\a\b\c");
let path_b = PathBuf::new(r"a\e\g");
let expected_diff_a_to_b = PathBuf::new(r"..\..\..\e\g");
assert_eq!( pathdiff::diff_paths(&path_b, &path_a).unwrap(), expected_diff_a_to_b ); // Will work fine
assert_eq!( pathdiff::diff_paths(&path_b, &path_a_with_dot).unwrap(), expected_diff_a_to_b ); // Will panic
The second assert will fail with the left hand side being r"a/../../../../e/g/"
Lamby777Lamby777
Metadata
Metadata
Assignees
Labels
No labels