File tree Expand file tree Collapse file tree 1 file changed +11
-16
lines changed
Expand file tree Collapse file tree 1 file changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -326,27 +326,22 @@ exit 0
326326
327327 let result = hook. run_hook ( & [ TEXT ] ) . unwrap ( ) ;
328328
329- if let HookResult :: RunNotSuccessful {
329+ let HookResult :: RunNotSuccessful {
330330 code,
331331 stdout,
332332 stderr,
333333 hook : h,
334334 } = result
335- {
336- assert_eq ! ( code, Some ( 42 ) ) ;
337- assert_eq ! ( h, hook. hook) ;
338- assert_eq ! (
339- stdout. as_str( ) . trim_ascii_end( ) ,
340- TEXT ,
341- "{:?} != {TEXT:?} | {:?} != {:?}" ,
342- stdout. as_str( ) . trim_ascii_end( ) ,
343- stdout. as_str( ) . trim_ascii_end( ) . as_bytes( ) ,
344- TEXT . as_bytes( )
345- ) ;
346- assert ! ( stderr. is_empty( ) ) ;
347- } else {
348- panic ! ( "run_hook should've failed" ) ;
349- }
335+ else {
336+ unreachable ! ( "run_hook should've failed" ) ;
337+ } ;
338+
339+ let stdout = stdout. as_str ( ) . trim_ascii_end ( ) ;
340+
341+ assert_eq ! ( code, Some ( 42 ) ) ;
342+ assert_eq ! ( h, hook. hook) ;
343+ assert_eq ! ( stdout, TEXT , "{:?} != {TEXT:?}" , stdout) ;
344+ assert ! ( stderr. is_empty( ) ) ;
350345 }
351346
352347 #[ test]
You can’t perform that action at this time.
0 commit comments