| 1 | package cliscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ |
| 2 | |
| 3 | import ( |
| 4 | "bytesscip-go gomod github.com/golang/go/src go1.22 bytes/" |
| 5 | "errorsscip-go gomod github.com/golang/go/src go1.22 errors/" |
| 6 | "fmtscip-go gomod github.com/golang/go/src go1.22 fmt/" |
| 7 | "testingscip-go gomod github.com/golang/go/src go1.22 testing/" |
| 8 | |
| 9 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/" |
| 10 | ) |
| 11 | |
| 12 | func TestHandleExitCoder_nilscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestHandleExitCoder_nil().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 13 | exitCode := 0 |
| 14 | called := false |
| 15 | |
| 16 | OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = func(rc int) { |
| 17 | if !called { |
| 18 | exitCode = rc |
| 19 | called = true |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | defer func() { OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = fakeOsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/fakeOsExiter. }() |
| 24 | |
| 25 | HandleExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/HandleExitCoder().(nil) |
| 26 | |
| 27 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 0, exitCode) |
| 28 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, called) |
| 29 | } |
| 30 | |
| 31 | func TestHandleExitCoder_ExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestHandleExitCoder_ExitCoder().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 32 | exitCode := 0 |
| 33 | called := false |
| 34 | |
| 35 | OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = func(rc int) { |
| 36 | if !called { |
| 37 | exitCode = rc |
| 38 | called = true |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | defer func() { OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = fakeOsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/fakeOsExiter. }() |
| 43 | |
| 44 | HandleExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/HandleExitCoder().(Exitscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Exit().("galactic perimeter breach", 9)) |
| 45 | |
| 46 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 9, exitCode) |
| 47 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, called) |
| 48 | } |
| 49 | |
| 50 | func TestHandleExitCoder_ErrorExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestHandleExitCoder_ErrorExitCoder().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 51 | exitCode := 0 |
| 52 | called := false |
| 53 | |
| 54 | OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = func(rc int) { |
| 55 | if !called { |
| 56 | exitCode = rc |
| 57 | called = true |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | defer func() { OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = fakeOsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/fakeOsExiter. }() |
| 62 | |
| 63 | HandleExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/HandleExitCoder().(Exitscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Exit().(errorsscip-go gomod github.com/golang/go/src go1.22 errors/.Newscip-go gomod github.com/golang/go/src go1.22 errors/New().("galactic perimeter breach"), 9)) |
| 64 | |
| 65 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 9, exitCode) |
| 66 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, called) |
| 67 | } |
| 68 | |
| 69 | func TestHandleExitCoder_MultiErrorWithExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestHandleExitCoder_MultiErrorWithExitCoder().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 70 | exitCode := 0 |
| 71 | called := false |
| 72 | |
| 73 | OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = func(rc int) { |
| 74 | if !called { |
| 75 | exitCode = rc |
| 76 | called = true |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | defer func() { OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = fakeOsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/fakeOsExiter. }() |
| 81 | |
| 82 | exitErr := Exitscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Exit().("galactic perimeter breach", 9) |
| 83 | exitErr2 := Exitscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Exit().("last ExitCoder", 11) |
| 84 | |
| 85 | err := newMultiErrorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/newMultiError().(errorsscip-go gomod github.com/golang/go/src go1.22 errors/.Newscip-go gomod github.com/golang/go/src go1.22 errors/New().("wowsa"), errorsscip-go gomod github.com/golang/go/src go1.22 errors/.Newscip-go gomod github.com/golang/go/src go1.22 errors/New().("egad"), exitErr, exitErr2) |
| 86 | HandleExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/HandleExitCoder().(err) |
| 87 | |
| 88 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 11, exitCode) |
| 89 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, called) |
| 90 | } |
| 91 | |
| 92 | type exitFormatterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter# struct { |
| 93 | codescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter#code. int |
| 94 | } |
| 95 | |
| 96 | func (f *exitFormatterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter#) Formatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter#Format().(s fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Statescip-go gomod github.com/golang/go/src go1.22 fmt/State#, verb rune) { |
| 97 | _, _ = s.Writescip-go gomod github.com/golang/go/src go1.22 fmt/State#Write().([]byte("some other special")) |
| 98 | } |
| 99 | |
| 100 | func (f *exitFormatterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter#) ExitCodescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter#ExitCode().() int { |
| 101 | return f.codescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter#code. |
| 102 | } |
| 103 | |
| 104 | func (f *exitFormatterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter#) Errorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter#Error().() string { |
| 105 | return fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.22 fmt/Sprintf().("my special error code %d", f.codescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter#code.) |
| 106 | } |
| 107 | |
| 108 | func TestHandleExitCoder_ErrorFormatterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestHandleExitCoder_ErrorFormatter().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 109 | exitCode := 0 |
| 110 | called := false |
| 111 | |
| 112 | OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = func(rc int) { |
| 113 | if !called { |
| 114 | exitCode = rc |
| 115 | called = true |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | oldWriter := ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrWriter. |
| 120 | var buf bytesscip-go gomod github.com/golang/go/src go1.22 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.22 bytes/Buffer# |
| 121 | ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrWriter. = &buf |
| 122 | defer func() { |
| 123 | OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = fakeOsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/fakeOsExiter. |
| 124 | ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrWriter. = oldWriter |
| 125 | }() |
| 126 | |
| 127 | exitErr := Exitscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Exit().("galactic perimeter breach", 9) |
| 128 | exitErr2 := Exitscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Exit().("last ExitCoder", 11) |
| 129 | exitErr3 := &exitFormatterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter#{codescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/exitFormatter#code.: 12} |
| 130 | |
| 131 | // add some recursion for multi error to fix test coverage |
| 132 | err := newMultiErrorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/newMultiError().(errorsscip-go gomod github.com/golang/go/src go1.22 errors/.Newscip-go gomod github.com/golang/go/src go1.22 errors/New().("wowsa"), errorsscip-go gomod github.com/golang/go/src go1.22 errors/.Newscip-go gomod github.com/golang/go/src go1.22 errors/New().("egad"), exitErr3, newMultiErrorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/newMultiError().(exitErr, exitErr2)) |
| 133 | HandleExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/HandleExitCoder().(err) |
| 134 | |
| 135 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 11, exitCode) |
| 136 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, called) |
| 137 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Containsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Contains().(t, buf.Stringscip-go gomod github.com/golang/go/src go1.22 bytes/Buffer#String().(), "some other special") |
| 138 | } |
| 139 | |
| 140 | func TestHandleExitCoder_MultiErrorWithoutExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestHandleExitCoder_MultiErrorWithoutExitCoder().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 141 | exitCode := 0 |
| 142 | called := false |
| 143 | |
| 144 | OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = func(rc int) { |
| 145 | if !called { |
| 146 | exitCode = rc |
| 147 | called = true |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | defer func() { OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = fakeOsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/fakeOsExiter. }() |
| 152 | |
| 153 | err := newMultiErrorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/newMultiError().(errorsscip-go gomod github.com/golang/go/src go1.22 errors/.Newscip-go gomod github.com/golang/go/src go1.22 errors/New().("wowsa"), errorsscip-go gomod github.com/golang/go/src go1.22 errors/.Newscip-go gomod github.com/golang/go/src go1.22 errors/New().("egad")) |
| 154 | HandleExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/HandleExitCoder().(err) |
| 155 | |
| 156 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 1, exitCode) |
| 157 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, called) |
| 158 | } |
| 159 | |
| 160 | // make a stub to not import pkg/errors |
| 161 | type ErrorWithFormatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrorWithFormat# struct { |
| 162 | errorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrorWithFormat#error. |
| 163 | } |
| 164 | |
| 165 | func NewErrorWithFormatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NewErrorWithFormat().(m string) *ErrorWithFormatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrorWithFormat# { |
| 166 | return &ErrorWithFormatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrorWithFormat#{errorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrorWithFormat#error.: errorsscip-go gomod github.com/golang/go/src go1.22 errors/.Newscip-go gomod github.com/golang/go/src go1.22 errors/New().(m)} |
| 167 | } |
| 168 | |
| 169 | func (f *ErrorWithFormatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrorWithFormat#) Formatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrorWithFormat#Format().(s fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Statescip-go gomod github.com/golang/go/src go1.22 fmt/State#, verb rune) { |
| 170 | fmtscip-go gomod github.com/golang/go/src go1.22 fmt/.Fprintfscip-go gomod github.com/golang/go/src go1.22 fmt/Fprintf().(s, "This the format: %v", f.errorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrorWithFormat#error.) |
| 171 | } |
| 172 | |
| 173 | func TestHandleExitCoder_ErrorWithFormatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestHandleExitCoder_ErrorWithFormat().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 174 | called := false |
| 175 | |
| 176 | OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = func(int) { |
| 177 | if !called { |
| 178 | called = true |
| 179 | } |
| 180 | } |
| 181 | ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrWriter. = &bytesscip-go gomod github.com/golang/go/src go1.22 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.22 bytes/Buffer#{} |
| 182 | |
| 183 | defer func() { |
| 184 | OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = fakeOsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/fakeOsExiter. |
| 185 | ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrWriter. = fakeErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/fakeErrWriter. |
| 186 | }() |
| 187 | |
| 188 | err := Exitscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Exit().(NewErrorWithFormatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NewErrorWithFormat().("I am formatted"), 1) |
| 189 | HandleExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/HandleExitCoder().(err) |
| 190 | |
| 191 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, called) |
| 192 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrWriter..(*bytesscip-go gomod github.com/golang/go/src go1.22 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.22 bytes/Buffer#).Stringscip-go gomod github.com/golang/go/src go1.22 bytes/Buffer#String().(), "This the format: I am formatted\n") |
| 193 | } |
| 194 | |
| 195 | func TestHandleExitCoder_MultiErrorWithFormatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestHandleExitCoder_MultiErrorWithFormat().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 196 | called := false |
| 197 | |
| 198 | OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = func(int) { |
| 199 | if !called { |
| 200 | called = true |
| 201 | } |
| 202 | } |
| 203 | ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrWriter. = &bytesscip-go gomod github.com/golang/go/src go1.22 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.22 bytes/Buffer#{} |
| 204 | |
| 205 | defer func() { OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = fakeOsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/fakeOsExiter. }() |
| 206 | |
| 207 | err := newMultiErrorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/newMultiError().(NewErrorWithFormatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NewErrorWithFormat().("err1"), NewErrorWithFormatscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/NewErrorWithFormat().("err2")) |
| 208 | HandleExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/HandleExitCoder().(err) |
| 209 | |
| 210 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, called) |
| 211 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrWriter..(*bytesscip-go gomod github.com/golang/go/src go1.22 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.22 bytes/Buffer#).Stringscip-go gomod github.com/golang/go/src go1.22 bytes/Buffer#String().(), "This the format: err1\nThis the format: err2\n") |
| 212 | } |
| 213 | |
| 214 | func TestMultiErrorErrorsCopyscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestMultiErrorErrorsCopy().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 215 | errList := []error{ |
| 216 | errorsscip-go gomod github.com/golang/go/src go1.22 errors/.Newscip-go gomod github.com/golang/go/src go1.22 errors/New().("foo"), |
| 217 | errorsscip-go gomod github.com/golang/go/src go1.22 errors/.Newscip-go gomod github.com/golang/go/src go1.22 errors/New().("bar"), |
| 218 | errorsscip-go gomod github.com/golang/go/src go1.22 errors/.Newscip-go gomod github.com/golang/go/src go1.22 errors/New().("baz"), |
| 219 | } |
| 220 | me := newMultiErrorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/newMultiError().(errList...) |
| 221 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, errList, me.Errorsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/MultiError#Errors.()) |
| 222 | } |
| 223 | |
| 224 | func TestErrRequiredFlags_Errorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestErrRequiredFlags_Error().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 225 | missingFlags := []string{"flag1", "flag2"} |
| 226 | err := &errRequiredFlagsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/errRequiredFlags#{missingFlagsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/errRequiredFlags#missingFlags.: missingFlags} |
| 227 | expectedMsg := "Required flags \"flag1, flag2\" not set" |
| 228 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expectedMsg, err.Errorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/errRequiredFlags#Error().()) |
| 229 | |
| 230 | missingFlags = []string{"flag1"} |
| 231 | err = &errRequiredFlagsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/errRequiredFlags#{missingFlagsscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/errRequiredFlags#missingFlags.: missingFlags} |
| 232 | expectedMsg = "Required flag \"flag1\" not set" |
| 233 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expectedMsg, err.Errorscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/errRequiredFlags#Error().()) |
| 234 | } |
| 235 | |
| 236 | func TestHandleExitCoder_ExitCoderEmptyMessagescip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/TestHandleExitCoder_ExitCoderEmptyMessage().(t *testingscip-go gomod github.com/golang/go/src go1.22 testing/.Tscip-go gomod github.com/golang/go/src go1.22 testing/T#) { |
| 237 | exitCode := 0 |
| 238 | called := false |
| 239 | |
| 240 | OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = func(rc int) { |
| 241 | if !called { |
| 242 | exitCode = rc |
| 243 | called = true |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | defer func() { OsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/OsExiter. = fakeOsExiterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/fakeOsExiter. }() |
| 248 | |
| 249 | // Capture stderr output |
| 250 | savedErrWriter := ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrWriter. |
| 251 | var errBuf bytesscip-go gomod github.com/golang/go/src go1.22 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.22 bytes/Buffer# |
| 252 | ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrWriter. = &errBuf |
| 253 | defer func() { ErrWriterscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/ErrWriter. = savedErrWriter }() |
| 254 | |
| 255 | HandleExitCoderscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/HandleExitCoder().(Exitscip-go gomod github.com/urfave/cli/v3 . `github.com/urfave/cli/v3`/Exit().("", 42)) |
| 256 | |
| 257 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 42, exitCode) |
| 258 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, called) |
| 259 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Emptyscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Empty().(t, errBuf.Stringscip-go gomod github.com/golang/go/src go1.22 bytes/Buffer#String().(), "expected no output to stderr for empty exit message") |
| 260 | } |