@@ -49,37 +49,37 @@ fn check_entries(tests_path: &Path, bad: &mut bool) {
4949
5050pub fn check ( path : & Path , bad : & mut bool ) {
5151 check_entries ( & path, bad) ;
52- for path in & [ & path. join ( "ui" ) , & path. join ( "ui-fulldeps" ) ] {
53- crate :: walk:: walk_no_read ( path, |_| false , & mut |entry| {
54- let file_path = entry. path ( ) ;
55- if let Some ( ext) = file_path. extension ( ) {
56- if ext == "stderr" || ext == "stdout" {
57- // Test output filenames have one of the formats:
58- // ```
59- // $testname.stderr
60- // $testname.$mode.stderr
61- // $testname.$revision.stderr
62- // $testname.$revision.$mode.stderr
63- // ```
64- //
65- // For now, just make sure that there is a corresponding
66- // `$testname.rs` file.
67- //
68- // NB: We do not use file_stem() as some file names have multiple `.`s and we
69- // must strip all of them.
70- let testname =
71- file_path. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . split_once ( '.' ) . unwrap ( ) . 0 ;
72- if !file_path. with_file_name ( testname) . with_extension ( "rs" ) . exists ( ) {
73- tidy_error ! ( bad, "Stray file with UI testing output: {:?}" , file_path) ;
74- }
52+ let ( ui, ui_fulldeps) = ( path. join ( "ui" ) , path. join ( "ui-fulldeps" ) ) ;
53+ let paths = [ ui. as_path ( ) , ui_fulldeps. as_path ( ) ] ;
54+ crate :: walk:: walk_no_read ( & paths, |_| false , & mut |entry| {
55+ let file_path = entry. path ( ) ;
56+ if let Some ( ext) = file_path. extension ( ) {
57+ if ext == "stderr" || ext == "stdout" {
58+ // Test output filenames have one of the formats:
59+ // ```
60+ // $testname.stderr
61+ // $testname.$mode.stderr
62+ // $testname.$revision.stderr
63+ // $testname.$revision.$mode.stderr
64+ // ```
65+ //
66+ // For now, just make sure that there is a corresponding
67+ // `$testname.rs` file.
68+ //
69+ // NB: We do not use file_stem() as some file names have multiple `.`s and we
70+ // must strip all of them.
71+ let testname =
72+ file_path. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . split_once ( '.' ) . unwrap ( ) . 0 ;
73+ if !file_path. with_file_name ( testname) . with_extension ( "rs" ) . exists ( ) {
74+ tidy_error ! ( bad, "Stray file with UI testing output: {:?}" , file_path) ;
75+ }
7576
76- if let Ok ( metadata) = fs:: metadata ( file_path) {
77- if metadata. len ( ) == 0 {
78- tidy_error ! ( bad, "Empty file with UI testing output: {:?}" , file_path) ;
79- }
77+ if let Ok ( metadata) = fs:: metadata ( file_path) {
78+ if metadata. len ( ) == 0 {
79+ tidy_error ! ( bad, "Empty file with UI testing output: {:?}" , file_path) ;
8080 }
8181 }
8282 }
83- } ) ;
84- }
83+ }
84+ } ) ;
8585}
0 commit comments