@@ -137,41 +137,39 @@ fn windows_open_special() {
137137 "COM8" , "COM9" , "COM¹" , "COM²" , "COM³" , "LPT0" , "LPT1" , "LPT2" , "LPT3" , "LPT4" , "LPT5" ,
138138 "LPT6" , "LPT7" , "LPT8" , "LPT9" , "LPT¹" , "LPT²" , "LPT³" ,
139139 ] {
140- for prefix in & [ "" , "." , " ." , ".\\ " , ".\\ ." , ". \\ ." , ".\\ ." ] {
141- for suffix in & [
142- "" ,
143- " " ,
144- "." ,
145- ". " ,
146- ".ext" ,
147- ".ext." ,
148- ".ext. " ,
149- ".ext " ,
150- ".ext.more" ,
151- ".ext.more." ,
152- ".ext.more " ,
153- ".ext.more. " ,
154- ".ext.more ." ,
155- ] {
156- let name = format ! ( "{}{}{}" , prefix, device, suffix) ;
157- eprintln ! ( "testing '{}'" , name) ;
158-
159- match tmpdir. open ( & name) . unwrap_err ( ) . kind ( ) {
160- std:: io:: ErrorKind :: NotFound | std:: io:: ErrorKind :: PermissionDenied => { }
161- kind => panic ! ( "unexpected error: {:?}" , kind) ,
162- }
163-
164- let mut options = cap_std:: fs:: OpenOptions :: new ( ) ;
165- options. write ( true ) ;
166- match tmpdir. open_with ( & name, & options) . unwrap_err ( ) . kind ( ) {
167- std:: io:: ErrorKind :: NotFound | std:: io:: ErrorKind :: PermissionDenied => { }
168- kind => panic ! ( "unexpected error: {:?}" , kind) ,
169- }
170-
171- match tmpdir. create ( & name) . unwrap_err ( ) . kind ( ) {
172- std:: io:: ErrorKind :: NotFound | std:: io:: ErrorKind :: PermissionDenied => { }
173- kind => panic ! ( "unexpected error: {:?}" , kind) ,
174- }
140+ for suffix in & [
141+ "" ,
142+ " " ,
143+ "." ,
144+ ". " ,
145+ ".ext" ,
146+ ".ext." ,
147+ ".ext. " ,
148+ ".ext " ,
149+ ".ext.more" ,
150+ ".ext.more." ,
151+ ".ext.more " ,
152+ ".ext.more. " ,
153+ ".ext.more ." ,
154+ ] {
155+ let name = format ! ( "{}{}{}" , device, suffix) ;
156+ eprintln ! ( "testing '{}'" , name) ;
157+
158+ match tmpdir. open ( & name) . unwrap_err ( ) . kind ( ) {
159+ std:: io:: ErrorKind :: NotFound | std:: io:: ErrorKind :: PermissionDenied => { }
160+ kind => panic ! ( "unexpected error: {:?}" , kind) ,
161+ }
162+
163+ let mut options = cap_std:: fs:: OpenOptions :: new ( ) ;
164+ options. write ( true ) ;
165+ match tmpdir. open_with ( & name, & options) . unwrap_err ( ) . kind ( ) {
166+ std:: io:: ErrorKind :: NotFound | std:: io:: ErrorKind :: PermissionDenied => { }
167+ kind => panic ! ( "unexpected error: {:?}" , kind) ,
168+ }
169+
170+ match tmpdir. create ( & name) . unwrap_err ( ) . kind ( ) {
171+ std:: io:: ErrorKind :: NotFound | std:: io:: ErrorKind :: PermissionDenied => { }
172+ kind => panic ! ( "unexpected error: {:?}" , kind) ,
175173 }
176174 }
177175 }
0 commit comments