MCPcopy
hub / github.com/urfave/cli / TestHandleExitCoder_ExitCoder

Function TestHandleExitCoder_ExitCoder

errors_test.go:31–48  ·  errors_test.go::TestHandleExitCoder_ExitCoder
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestHandleExitCoder_ExitCoder(t *testing.T) {
32 exitCode := 0
33 called := false
34
35 OsExiter = func(rc int) {
36 if !called {
37 exitCode = rc
38 called = true
39 }
40 }
41
42 defer func() { OsExiter = fakeOsExiter }()
43
44 HandleExitCoder(Exit("galactic perimeter breach", 9))
45
46 assert.Equal(t, 9, exitCode)
47 assert.True(t, called)
48}
49
50func TestHandleExitCoder_ErrorExitCoder(t *testing.T) {
51 exitCode := 0

Callers

nothing calls this directly

Calls 2

HandleExitCoderFunction · 0.85
ExitFunction · 0.85

Tested by

no test coverage detected