File tree 2 files changed +7
-17
lines changed
src/tools/compiletest/src
2 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -1121,13 +1121,11 @@ fn expand_variables(mut value: String, config: &Config) -> String {
1121
1121
/// normalize-*: "REGEX" -> "REPLACEMENT"
1122
1122
/// ```
1123
1123
fn parse_normalize_rule ( header : & str ) -> Option < ( String , String ) > {
1124
- // FIXME(#126370): A colon after the header name should be mandatory, but
1125
- // currently is not, and there are many tests that lack the colon.
1126
1124
// FIXME: Support escaped double-quotes in strings.
1127
1125
let captures = static_regex ! (
1128
1126
r#"(?x) # (verbose mode regex)
1129
1127
^
1130
- [^:\s]+:? \s* # (header name followed by optional colon)
1128
+ [^:\s]+:\s* # (header name followed by colon)
1131
1129
"(?<regex>[^"]*)" # "REGEX"
1132
1130
\s+->\s+ # ->
1133
1131
"(?<replacement>[^"]*)" # "REPLACEMENT"
Original file line number Diff line number Diff line change @@ -33,20 +33,11 @@ fn make_test_description<R: Read>(
33
33
34
34
#[ test]
35
35
fn test_parse_normalize_rule ( ) {
36
- let good_data = & [
37
- (
38
- r#"normalize-stderr-32bit: "something (32 bits)" -> "something ($WORD bits)""# ,
39
- "something (32 bits)" ,
40
- "something ($WORD bits)" ,
41
- ) ,
42
- // FIXME(#126370): A colon after the header name should be mandatory,
43
- // but currently is not, and there are many tests that lack the colon.
44
- (
45
- r#"normalize-stderr-32bit "something (32 bits)" -> "something ($WORD bits)""# ,
46
- "something (32 bits)" ,
47
- "something ($WORD bits)" ,
48
- ) ,
49
- ] ;
36
+ let good_data = & [ (
37
+ r#"normalize-stderr-32bit: "something (32 bits)" -> "something ($WORD bits)""# ,
38
+ "something (32 bits)" ,
39
+ "something ($WORD bits)" ,
40
+ ) ] ;
50
41
51
42
for & ( input, expected_regex, expected_replacement) in good_data {
52
43
let parsed = parse_normalize_rule ( input) ;
@@ -56,6 +47,7 @@ fn test_parse_normalize_rule() {
56
47
}
57
48
58
49
let bad_data = & [
50
+ r#"normalize-stderr-32bit "something (32 bits)" -> "something ($WORD bits)""# ,
59
51
r#"normalize-stderr-16bit: something (16 bits) -> something ($WORD bits)"# ,
60
52
r#"normalize-stderr-32bit: something (32 bits) -> something ($WORD bits)"# ,
61
53
r#"normalize-stderr-32bit: "something (32 bits) -> something ($WORD bits)"# ,
You can’t perform that action at this time.
0 commit comments