@@ -40,8 +40,8 @@ pub struct TestProps {
40
40
pub check_stdout : bool ,
41
41
// Don't force a --crate-type=dylib flag on the command line
42
42
pub no_prefer_dynamic : bool ,
43
- // Don't run --pretty expanded when running pretty printing tests
44
- pub no_pretty_expanded : bool ,
43
+ // Run --pretty expanded when running pretty printing tests
44
+ pub pretty_expanded : bool ,
45
45
// Which pretty mode are we testing with, default to 'normal'
46
46
pub pretty_mode : String ,
47
47
// Only compare pretty output and don't try compiling
@@ -62,7 +62,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
62
62
let mut force_host = false ;
63
63
let mut check_stdout = false ;
64
64
let mut no_prefer_dynamic = false ;
65
- let mut no_pretty_expanded = false ;
65
+ let mut pretty_expanded = false ;
66
66
let mut pretty_mode = None ;
67
67
let mut pretty_compare_only = false ;
68
68
let mut forbid_output = Vec :: new ( ) ;
@@ -96,8 +96,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
96
96
no_prefer_dynamic = parse_no_prefer_dynamic ( ln) ;
97
97
}
98
98
99
- if !no_pretty_expanded {
100
- no_pretty_expanded = parse_no_pretty_expanded ( ln) ;
99
+ if !pretty_expanded {
100
+ pretty_expanded = parse_pretty_expanded ( ln) ;
101
101
}
102
102
103
103
if pretty_mode. is_none ( ) {
@@ -152,7 +152,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
152
152
force_host : force_host,
153
153
check_stdout : check_stdout,
154
154
no_prefer_dynamic : no_prefer_dynamic,
155
- no_pretty_expanded : no_pretty_expanded ,
155
+ pretty_expanded : pretty_expanded ,
156
156
pretty_mode : pretty_mode. unwrap_or ( "normal" . to_string ( ) ) ,
157
157
pretty_compare_only : pretty_compare_only,
158
158
forbid_output : forbid_output,
@@ -295,8 +295,8 @@ fn parse_no_prefer_dynamic(line: &str) -> bool {
295
295
parse_name_directive ( line, "no-prefer-dynamic" )
296
296
}
297
297
298
- fn parse_no_pretty_expanded ( line : & str ) -> bool {
299
- parse_name_directive ( line, "no- pretty-expanded" )
298
+ fn parse_pretty_expanded ( line : & str ) -> bool {
299
+ parse_name_directive ( line, "pretty-expanded" )
300
300
}
301
301
302
302
fn parse_pretty_mode ( line : & str ) -> Option < String > {
@@ -340,7 +340,8 @@ fn parse_pp_exact(line: &str, testfile: &Path) -> Option<PathBuf> {
340
340
}
341
341
342
342
fn parse_name_directive ( line : & str , directive : & str ) -> bool {
343
- line. contains ( directive)
343
+ // This 'no-' rule is a quick hack to allow pretty-expanded and no-pretty-expanded to coexist
344
+ line. contains ( directive) && !line. contains ( & ( "no-" . to_string ( ) + directive) )
344
345
}
345
346
346
347
pub fn parse_name_value_directive ( line : & str , directive : & str )
0 commit comments