MCPcopy
hub / github.com/yuk7/wsldl / TestExitCodeError

Function TestExitCodeError

src/lib/errutil/errutil_test.go:58–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

56}
57
58func TestExitCodeError(t *testing.T) {
59 t.Parallel()
60
61 err := NewExitCodeError(42, true)
62 ec, ok := err.(*ExitCodeError)
63 if !ok {
64 t.Fatalf("error type = %T, want *ExitCodeError", err)
65 }
66 if ec.Code != 42 || ec.Pause != true {
67 t.Fatalf("ExitCodeError fields mismatch: %+v", ec)
68 }
69 if got := ec.Error(); got != "exit requested" {
70 t.Fatalf("ExitCodeError.Error() = %q, want %q", got, "exit requested")
71 }
72}
73
74func TestFormatError(t *testing.T) {
75 t.Parallel()

Callers

nothing calls this directly

Calls 2

NewExitCodeErrorFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected