@@ -188,9 +188,8 @@ mod tests {
188188 for & d in & [ 0 , 1 , 2 ] {
189189 for & e in & [ 0 , 1 , 2 ] {
190190 for & f in & [ 0 , 1 , 2 ] {
191- use std:: fs:: { self , File } ;
191+ use std:: fs:: File ;
192192 use std:: io:: Write ;
193- use std:: process:: Command ;
194193 let mut alef = Vec :: new ( ) ;
195194 let mut bet = Vec :: new ( ) ;
196195 alef. write_all ( if a == 0 { b"a\n " } else { b"b\n " } )
@@ -238,17 +237,18 @@ mod tests {
238237 let _ = fb;
239238 #[ cfg( not( windows) ) ] // there's no ed on windows
240239 {
240+ use std:: process:: Command ;
241241 let output = Command :: new ( "ed" )
242242 . arg ( & format ! ( "{target}/alef" ) )
243243 . stdin ( File :: open ( & format ! ( "{target}/ab.ed" ) ) . unwrap ( ) )
244244 . output ( )
245245 . unwrap ( ) ;
246246 assert ! ( output. status. success( ) , "{output:?}" ) ;
247+ //println!("{}", String::from_utf8_lossy(&output.stdout));
248+ //println!("{}", String::from_utf8_lossy(&output.stderr));
249+ let alef = std:: fs:: read ( & format ! ( "{target}/alef" ) ) . unwrap ( ) ;
250+ assert_eq ! ( alef, bet) ;
247251 }
248- //println!("{}", String::from_utf8_lossy(&output.stdout));
249- //println!("{}", String::from_utf8_lossy(&output.stderr));
250- let alef = fs:: read ( & format ! ( "{target}/alef" ) ) . unwrap ( ) ;
251- assert_eq ! ( alef, bet) ;
252252 }
253253 }
254254 }
@@ -268,9 +268,8 @@ mod tests {
268268 for & d in & [ 0 , 1 , 2 ] {
269269 for & e in & [ 0 , 1 , 2 ] {
270270 for & f in & [ 0 , 1 , 2 ] {
271- use std:: fs:: { self , File } ;
271+ use std:: fs:: File ;
272272 use std:: io:: Write ;
273- use std:: process:: Command ;
274273 let mut alef = Vec :: new ( ) ;
275274 let mut bet = Vec :: new ( ) ;
276275 alef. write_all ( if a == 0 { b"\n " } else { b"b\n " } ) . unwrap ( ) ;
@@ -312,17 +311,18 @@ mod tests {
312311 let _ = fb;
313312 #[ cfg( not( windows) ) ] // there's no ed on windows
314313 {
314+ use std:: process:: Command ;
315315 let output = Command :: new ( "ed" )
316316 . arg ( & format ! ( "{target}/alef_" ) )
317317 . stdin ( File :: open ( & format ! ( "{target}/ab_.ed" ) ) . unwrap ( ) )
318318 . output ( )
319319 . unwrap ( ) ;
320320 assert ! ( output. status. success( ) , "{output:?}" ) ;
321+ //println!("{}", String::from_utf8_lossy(&output.stdout));
322+ //println!("{}", String::from_utf8_lossy(&output.stderr));
323+ let alef = std:: fs:: read ( & format ! ( "{target}/alef_" ) ) . unwrap ( ) ;
324+ assert_eq ! ( alef, bet) ;
321325 }
322- //println!("{}", String::from_utf8_lossy(&output.stdout));
323- //println!("{}", String::from_utf8_lossy(&output.stderr));
324- let alef = fs:: read ( & format ! ( "{target}/alef_" ) ) . unwrap ( ) ;
325- assert_eq ! ( alef, bet) ;
326326 }
327327 }
328328 }
@@ -342,9 +342,8 @@ mod tests {
342342 for & d in & [ 0 , 1 , 2 ] {
343343 for & e in & [ 0 , 1 , 2 ] {
344344 for & f in & [ 0 , 1 , 2 ] {
345- use std:: fs:: { self , File } ;
345+ use std:: fs:: File ;
346346 use std:: io:: Write ;
347- use std:: process:: Command ;
348347 let mut alef = Vec :: new ( ) ;
349348 let mut bet = Vec :: new ( ) ;
350349 alef. write_all ( if a == 0 { b"a\n " } else { b"f\n " } )
@@ -392,17 +391,18 @@ mod tests {
392391 let _ = fb;
393392 #[ cfg( not( windows) ) ] // there's no ed on windows
394393 {
394+ use std:: process:: Command ;
395395 let output = Command :: new ( "ed" )
396396 . arg ( & format ! ( "{target}/alefr" ) )
397397 . stdin ( File :: open ( & format ! ( "{target}/abr.ed" ) ) . unwrap ( ) )
398398 . output ( )
399399 . unwrap ( ) ;
400400 assert ! ( output. status. success( ) , "{output:?}" ) ;
401+ //println!("{}", String::from_utf8_lossy(&output.stdout));
402+ //println!("{}", String::from_utf8_lossy(&output.stderr));
403+ let alef = std:: fs:: read ( & format ! ( "{target}/alefr" ) ) . unwrap ( ) ;
404+ assert_eq ! ( alef, bet) ;
401405 }
402- //println!("{}", String::from_utf8_lossy(&output.stdout));
403- //println!("{}", String::from_utf8_lossy(&output.stderr));
404- let alef = fs:: read ( & format ! ( "{target}/alefr" ) ) . unwrap ( ) ;
405- assert_eq ! ( alef, bet) ;
406406 }
407407 }
408408 }
0 commit comments