File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -58,17 +58,18 @@ func testExit(stageHarness *test_case_harness.TestCaseHarness) error {
58
58
return fmt .Errorf ("Expected program to exit with 0 exit code, program is still running." )
59
59
}
60
60
61
- logger .Successf ("✓ Program exited successfully" )
62
-
63
61
if exitCode != 0 {
64
62
return fmt .Errorf ("Expected 0 as exit code, got %d" , exitCode )
65
63
}
66
64
67
65
// Most shells return nothing but bash returns the string "exit" when it exits, we allow both styles
68
66
if len (output ) > 0 && strings .TrimSpace (output ) != "exit" {
67
+ // If there is some unexpected output, we need to log it before returning an error
68
+ asserter .LogRemainingOutput ()
69
69
return fmt .Errorf ("Expected no output after exit command, got %q" , output )
70
70
}
71
71
72
+ logger .Successf ("✓ Program exited successfully" )
72
73
logger .Successf ("✓ No output after exit command" )
73
74
74
75
return logAndQuit (asserter , nil )
You can’t perform that action at this time.
0 commit comments