diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 63d1efd42fa..7479be90797 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -1121,13 +1121,11 @@ fn expand_variables(mut value: String, config: &Config) -> String { /// normalize-*: "REGEX" -> "REPLACEMENT" /// ``` fn parse_normalize_rule(header: &str) -> Option<(String, String)> { - // FIXME(#126370): A colon after the header name should be mandatory, but - // currently is not, and there are many tests that lack the colon. // FIXME: Support escaped double-quotes in strings. let captures = static_regex!( r#"(?x) # (verbose mode regex) ^ - [^:\s]+:?\s* # (header name followed by optional colon) + [^:\s]+:\s* # (header name followed by colon) "(?[^"]*)" # "REGEX" \s+->\s+ # -> "(?[^"]*)" # "REPLACEMENT" diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs index 61a85b84ad6..c790eb18d67 100644 --- a/src/tools/compiletest/src/header/tests.rs +++ b/src/tools/compiletest/src/header/tests.rs @@ -33,20 +33,11 @@ fn make_test_description( #[test] fn test_parse_normalize_rule() { - let good_data = &[ - ( - r#"normalize-stderr-32bit: "something (32 bits)" -> "something ($WORD bits)""#, - "something (32 bits)", - "something ($WORD bits)", - ), - // FIXME(#126370): A colon after the header name should be mandatory, - // but currently is not, and there are many tests that lack the colon. - ( - r#"normalize-stderr-32bit "something (32 bits)" -> "something ($WORD bits)""#, - "something (32 bits)", - "something ($WORD bits)", - ), - ]; + let good_data = &[( + r#"normalize-stderr-32bit: "something (32 bits)" -> "something ($WORD bits)""#, + "something (32 bits)", + "something ($WORD bits)", + )]; for &(input, expected_regex, expected_replacement) in good_data { let parsed = parse_normalize_rule(input); @@ -56,6 +47,7 @@ fn test_parse_normalize_rule() { } let bad_data = &[ + r#"normalize-stderr-32bit "something (32 bits)" -> "something ($WORD bits)""#, r#"normalize-stderr-16bit: something (16 bits) -> something ($WORD bits)"#, r#"normalize-stderr-32bit: something (32 bits) -> something ($WORD bits)"#, r#"normalize-stderr-32bit: "something (32 bits) -> something ($WORD bits)"#,