(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestHandleExitCoder_nil(t *testing.T) { |
| 13 | exitCode := 0 |
| 14 | called := false |
| 15 | |
| 16 | OsExiter = func(rc int) { |
| 17 | if !called { |
| 18 | exitCode = rc |
| 19 | called = true |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | defer func() { OsExiter = fakeOsExiter }() |
| 24 | |
| 25 | HandleExitCoder(nil) |
| 26 | |
| 27 | assert.Equal(t, 0, exitCode) |
| 28 | assert.False(t, called) |
| 29 | } |
| 30 | |
| 31 | func TestHandleExitCoder_ExitCoder(t *testing.T) { |
| 32 | exitCode := 0 |
nothing calls this directly
no test coverage detected