diff options
| author | Zanie Blue <contact@zanie.dev> | 2024-07-02 23:12:06 -0500 |
|---|---|---|
| committer | The 8472 <git@infinite-source.de> | 2024-07-03 22:35:10 +0200 |
| commit | dd509c7a6399f2784fa940d27a9f463da7e81d58 (patch) | |
| tree | 3b2b2d07ac2c31137be18f4f7e35ca1162979862 | |
| parent | a7372372f6c3b81804c2b83f2a0e9c0bc7d08e13 (diff) | |
| download | rust-dd509c7a6399f2784fa940d27a9f463da7e81d58.tar.gz rust-dd509c7a6399f2784fa940d27a9f463da7e81d58.zip | |
Add more test cases for path comparisons
| -rw-r--r-- | library/std/src/path/tests.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/library/std/src/path/tests.rs b/library/std/src/path/tests.rs index 53a65c60b58..87a06a9ea91 100644 --- a/library/std/src/path/tests.rs +++ b/library/std/src/path/tests.rs @@ -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, @@ -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, |
