@@ -84,7 +84,9 @@ pub fn check(tests_path: impl AsRef<Path>, bad: &mut bool) {
84
84
}
85
85
} ) ;
86
86
87
- let Some ( ( test_name, _) ) = test. to_str ( ) . map ( |s| s. split_once ( '.' ) ) . flatten ( ) else {
87
+ let Some ( ( test_name, _) ) =
88
+ test. file_name ( ) . map ( OsStr :: to_str) . flatten ( ) . map ( |n| n. split_once ( '.' ) ) . flatten ( )
89
+ else {
88
90
continue ;
89
91
} ;
90
92
@@ -98,14 +100,20 @@ pub fn check(tests_path: impl AsRef<Path>, bad: &mut bool) {
98
100
for sibling in files_under_inspection. iter ( ) . filter ( |f| {
99
101
f. extension ( ) . map ( OsStr :: to_str) . flatten ( ) . is_some_and ( |ext| EXTENSIONS . contains ( & ext) )
100
102
} ) {
101
- let filename_components = sibling. to_str ( ) . unwrap ( ) . split ( '.' ) . collect :: < Vec < _ > > ( ) ;
102
- let file_prefix = filename_components[ 0 ] ;
103
+ let Some ( filename) = sibling. file_name ( ) . map ( OsStr :: to_str) . flatten ( ) else {
104
+ continue ;
105
+ } ;
106
+
107
+ let filename_components = filename. split ( '.' ) . collect :: < Vec < _ > > ( ) ;
108
+ let [ file_prefix, ..] = & filename_components[ ..] else {
109
+ continue ;
110
+ } ;
103
111
104
- let Some ( ( test_path, expected_revisions) ) = test_info. get ( file_prefix) else {
112
+ let Some ( ( test_path, expected_revisions) ) = test_info. get ( * file_prefix) else {
105
113
continue ;
106
114
} ;
107
115
108
- match filename_components[ ..] {
116
+ match & filename_components[ ..] {
109
117
// Cannot have a revision component, skip.
110
118
[ ] | [ _] => return ,
111
119
[ _, _] if !expected_revisions. is_empty ( ) => {
@@ -120,9 +128,9 @@ pub fn check(tests_path: impl AsRef<Path>, bad: &mut bool) {
120
128
[ _, _] => return ,
121
129
[ _, found_revision, .., extension] => {
122
130
if !IGNORES . contains ( & found_revision)
123
- && !expected_revisions. contains ( found_revision)
131
+ && !expected_revisions. contains ( * found_revision)
124
132
// This is from `//@ stderr-per-bitwidth`
125
- && !( extension == "stderr" && [ "32bit" , "64bit" ] . contains ( & found_revision) )
133
+ && !( * extension == "stderr" && [ "32bit" , "64bit" ] . contains ( & found_revision) )
126
134
{
127
135
// Found some unexpected revision-esque component that is not a known
128
136
// compare-mode or expected revision.
0 commit comments