@@ -40,8 +40,8 @@ pub struct TestProps {
4040 pub check_stdout : bool ,
4141 // Don't force a --crate-type=dylib flag on the command line
4242 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 ,
4545 // Which pretty mode are we testing with, default to 'normal'
4646 pub pretty_mode : String ,
4747 // Only compare pretty output and don't try compiling
@@ -62,7 +62,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
6262 let mut force_host = false ;
6363 let mut check_stdout = false ;
6464 let mut no_prefer_dynamic = false ;
65- let mut no_pretty_expanded = false ;
65+ let mut pretty_expanded = false ;
6666 let mut pretty_mode = None ;
6767 let mut pretty_compare_only = false ;
6868 let mut forbid_output = Vec :: new ( ) ;
@@ -96,8 +96,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
9696 no_prefer_dynamic = parse_no_prefer_dynamic ( ln) ;
9797 }
9898
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) ;
101101 }
102102
103103 if pretty_mode. is_none ( ) {
@@ -152,7 +152,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
152152 force_host : force_host,
153153 check_stdout : check_stdout,
154154 no_prefer_dynamic : no_prefer_dynamic,
155- no_pretty_expanded : no_pretty_expanded ,
155+ pretty_expanded : pretty_expanded ,
156156 pretty_mode : pretty_mode. unwrap_or ( "normal" . to_string ( ) ) ,
157157 pretty_compare_only : pretty_compare_only,
158158 forbid_output : forbid_output,
@@ -295,8 +295,8 @@ fn parse_no_prefer_dynamic(line: &str) -> bool {
295295 parse_name_directive ( line, "no-prefer-dynamic" )
296296}
297297
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" )
300300}
301301
302302fn parse_pretty_mode ( line : & str ) -> Option < String > {
@@ -340,7 +340,8 @@ fn parse_pp_exact(line: &str, testfile: &Path) -> Option<PathBuf> {
340340}
341341
342342fn 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) )
344345}
345346
346347pub fn parse_name_value_directive ( line : & str , directive : & str )
0 commit comments