(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestHandleExitCoder_ErrorExitCoder(t *testing.T) { |
| 51 | exitCode := 0 |
| 52 | called := false |
| 53 | |
| 54 | OsExiter = func(rc int) { |
| 55 | if !called { |
| 56 | exitCode = rc |
| 57 | called = true |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | defer func() { OsExiter = fakeOsExiter }() |
| 62 | |
| 63 | HandleExitCoder(Exit(errors.New("galactic perimeter breach"), 9)) |
| 64 | |
| 65 | assert.Equal(t, 9, exitCode) |
| 66 | assert.True(t, called) |
| 67 | } |
| 68 | |
| 69 | func TestHandleExitCoder_MultiErrorWithExitCoder(t *testing.T) { |
| 70 | exitCode := 0 |
nothing calls this directly
no test coverage detected