Skip to content

Commit

Permalink
Add more test cases for path comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb authored and the8472 committed Jul 3, 2024
1 parent a737237 commit dd509c7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions library/std/src/path/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,20 @@ pub fn test_compare() {
relative_from: Some("")
);

tc!("foo//", "foo",
eq: true,
starts_with: true,
ends_with: true,
relative_from: Some("")
);

tc!("foo///", "foo",
eq: true,
starts_with: true,
ends_with: true,
relative_from: Some("")
);

tc!("foo/.", "foo",
eq: true,
starts_with: true,
Expand All @@ -1559,6 +1573,20 @@ pub fn test_compare() {
relative_from: Some("")
);

tc!("foo/.//bar", "foo/bar",
eq: true,
starts_with: true,
ends_with: true,
relative_from: Some("")
);

tc!("foo//./bar", "foo/bar",
eq: true,
starts_with: true,
ends_with: true,
relative_from: Some("")
);

tc!("foo/bar", "foo",
eq: false,
starts_with: true,
Expand Down

0 comments on commit dd509c7

Please sign in to comment.