We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e87710 commit dfdf361Copy full SHA for dfdf361
library/std/src/path/tests.rs
@@ -1395,6 +1395,23 @@ fn into_rc() {
1395
assert_eq!(&*arc2, path);
1396
}
1397
1398
+#[test]
1399
+fn test_ord() {
1400
+ macro_rules! ord(
1401
+ ($ord:ident, $left:expr, $right:expr) => ( {
1402
+ assert_eq!(Path::new($left).cmp(&Path::new($right)), core::cmp::Ordering::$ord);
1403
+ });
1404
+ );
1405
+
1406
+ ord!(Less, "1", "2");
1407
+ ord!(Less, "/foo/bar", "/foo./bar");
1408
+ ord!(Less, "foo/bar", "foo/bar.");
1409
+ ord!(Equal, "foo/./bar", "foo/bar/");
1410
+ ord!(Equal, "foo/bar", "foo/bar/");
1411
+ ord!(Equal, "foo/bar", "foo/bar/.");
1412
+ ord!(Equal, "foo/bar", "foo/bar//");
1413
+}
1414
1415
#[bench]
1416
fn bench_path_cmp_fast_path_buf_sort(b: &mut test::Bencher) {
1417
let prefix = "my/home";
0 commit comments