@@ -366,24 +366,29 @@ impl Execs {
366366 let mut a = actual. lines ( ) ;
367367 let e = out. lines ( ) ;
368368
369- let diffs = if partial {
370- let mut min = self . diff_lines ( a. clone ( ) , e. clone ( ) , partial) ;
369+ if partial {
370+ let mut diffs = self . diff_lines ( a. clone ( ) , e. clone ( ) , partial) ;
371371 while let Some ( ..) = a. next ( ) {
372372 let a = self . diff_lines ( a. clone ( ) , e. clone ( ) , partial) ;
373- if a. len ( ) < min . len ( ) {
374- min = a;
373+ if a. len ( ) < diffs . len ( ) {
374+ diffs = a;
375375 }
376376 }
377- min
377+ ham:: expect ( diffs. is_empty ( ) ,
378+ format ! ( "expected to find:\n \
379+ {}\n \n \
380+ did not find in output:\n \
381+ {}", out,
382+ actual) )
378383 } else {
379- self . diff_lines ( a, e, partial)
380- } ;
381- ham :: expect ( diffs . is_empty ( ) ,
382- format ! ( "differences: \n \
383- {} \n \n \
384- other output: \n \
385- `{}`" , diffs . join ( " \n " ) ,
386- String :: from_utf8_lossy ( extra ) ) )
384+ let diffs = self . diff_lines ( a, e, partial) ;
385+ ham :: expect ( diffs . is_empty ( ) ,
386+ format ! ( "differences: \n \
387+ {} \n \n \
388+ other output: \n \
389+ `{}`" , diffs . join ( " \n " ) ,
390+ String :: from_utf8_lossy ( extra ) ) )
391+ }
387392
388393 }
389394
0 commit comments