From 726e33f0e34b077334f1bd3f06f46dfa04ee65b1 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 10 Apr 2025 08:40:22 +0200 Subject: [PATCH] path: add more Windows tests --- src/tools/miri/tests/pass/path.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/miri/tests/pass/path.rs b/src/tools/miri/tests/pass/path.rs index 299ee6cfe9dd..dbca0ea611f7 100644 --- a/src/tools/miri/tests/pass/path.rs +++ b/src/tools/miri/tests/pass/path.rs @@ -31,9 +31,14 @@ fn test_absolute() { assert_absolute_eq(r"\\?\PIPE\name", r"\\?\PIPE\name"); // Verbatim paths are always unchanged, no matter what. assert_absolute_eq(r"\\?\path.\to/file..", r"\\?\path.\to/file.."); - + // Trailing dot is removed here. assert_absolute_eq(r"C:\path..\to.\file.", r"C:\path..\to\file"); + // `..` is resolved here. + assert_absolute_eq(r"C:\path\to\..\file", r"C:\path\file"); + assert_absolute_eq(r"\\server\share\to\..\file", r"\\server\share\file"); + // Magic filename. assert_absolute_eq(r"COM1", r"\\.\COM1"); + assert_absolute_eq(r"C:\path\to\COM1", r"\\.\COM1"); } else { panic!("unsupported OS"); }