about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Macleod <alex@macleod.io>2023-07-14 21:28:19 +0000
committerAlex Macleod <alex@macleod.io>2023-07-14 21:32:44 +0000
commit1ce61836dc82dcda36b7016e682ff43ff6eb1a13 (patch)
tree0f98b75272690c7e01e5b40fa3a2fa683f7c30ca
parent079e544174b79c372b4b4b473a01d699f128c2de (diff)
downloadrust-1ce61836dc82dcda36b7016e682ff43ff6eb1a13.tar.gz
rust-1ce61836dc82dcda36b7016e682ff43ff6eb1a13.zip
Fix compiletest windows path finding with spaces
-rw-r--r--src/tools/compiletest/src/runtest.rs4
-rw-r--r--src/tools/compiletest/src/runtest/tests.rs8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index b91e1b09330..7eeb987063f 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -4149,8 +4149,8 @@ impl<'test> TestCx<'test> {
                   # Match paths that don't include spaces.
                   (?:\\[\pL\pN\.\-_']+)+\.\pL+
                 |
-                  # If the path starts with a well-known root, then allow spaces.
-                  \$(?:DIR|SRC_DIR|TEST_BUILD_DIR|BUILD_DIR|LIB_DIR)(?:\\[\pL\pN\.\-_' ]+)+
+                  # If the path starts with a well-known root, then allow spaces and no file extension.
+                  \$(?:DIR|SRC_DIR|TEST_BUILD_DIR|BUILD_DIR|LIB_DIR)(?:\\[\pL\pN\.\-_'\ ]+)+
                 )"#,
             )
             .unwrap()
diff --git a/src/tools/compiletest/src/runtest/tests.rs b/src/tools/compiletest/src/runtest/tests.rs
index 51105111175..fb3dd326a4c 100644
--- a/src/tools/compiletest/src/runtest/tests.rs
+++ b/src/tools/compiletest/src/runtest/tests.rs
@@ -8,8 +8,8 @@ fn normalize_platform_differences() {
         "$BUILD_DIR/../parser.rs"
     );
     assert_eq!(
-        TestCx::normalize_platform_differences(r"$DIR\bar.rs hello\nworld"),
-        r"$DIR/bar.rs hello\nworld"
+        TestCx::normalize_platform_differences(r"$DIR\bar.rs: hello\nworld"),
+        r"$DIR/bar.rs: hello\nworld"
     );
     assert_eq!(
         TestCx::normalize_platform_differences(r"either bar\baz.rs or bar\baz\mod.rs"),
@@ -27,8 +27,8 @@ fn normalize_platform_differences() {
     );
     assert_eq!(TestCx::normalize_platform_differences(r"$DIR\foo.rs:12:11"), "$DIR/foo.rs:12:11",);
     assert_eq!(
-        TestCx::normalize_platform_differences(r"$DIR\path with spaces 'n' quotes"),
-        "$DIR/path with spaces 'n' quotes",
+        TestCx::normalize_platform_differences(r"$DIR\path with\spaces 'n' quotes"),
+        "$DIR/path with/spaces 'n' quotes",
     );
     assert_eq!(
         TestCx::normalize_platform_differences(r"$DIR\file_with\no_extension"),