repo_path: capture current Vec<String> ordering by tests

The added test would fail if paths were purely ordered by concatenated strings.
I'm not sure if we want to preserve the current ordering, but let's not break
it for the moment.
This commit is contained in:
Yuya Nishihara 2023-11-25 21:56:02 +09:00
parent 3967f637dc
commit aba8c640be

View file

@ -306,9 +306,10 @@ mod tests {
fn test_order() { fn test_order() {
assert!(RepoPath::root() < repo_path("dir")); assert!(RepoPath::root() < repo_path("dir"));
assert!(repo_path("dir") < repo_path("dirx")); assert!(repo_path("dir") < repo_path("dirx"));
// '#' < '/' // '#' < '/', but ["dir", "sub"] < ["dir#"]
assert!(repo_path("dir") < repo_path("dir#")); assert!(repo_path("dir") < repo_path("dir#"));
assert!(repo_path("dir") < repo_path("dir/sub")); assert!(repo_path("dir") < repo_path("dir/sub"));
assert!(repo_path("dir/sub") < repo_path("dir#"));
assert!(repo_path("abc") < repo_path("dir/file")); assert!(repo_path("abc") < repo_path("dir/file"));
assert!(repo_path("dir") < repo_path("dir/file")); assert!(repo_path("dir") < repo_path("dir/file"));