(t *testing.T)
| 2159 | } |
| 2160 | |
| 2161 | func TestUsageStringRedirected(t *testing.T) { |
| 2162 | c := &Command{} |
| 2163 | |
| 2164 | c.usageFunc = func(cmd *Command) error { |
| 2165 | cmd.Print("[stdout1]") |
| 2166 | cmd.PrintErr("[stderr2]") |
| 2167 | cmd.Print("[stdout3]") |
| 2168 | return nil |
| 2169 | } |
| 2170 | |
| 2171 | expected := "[stdout1][stderr2][stdout3]" |
| 2172 | if got := c.UsageString(); got != expected { |
| 2173 | t.Errorf("Expected usage string to consider both stdout and stderr") |
| 2174 | } |
| 2175 | } |
| 2176 | |
| 2177 | func TestCommandPrintRedirection(t *testing.T) { |
| 2178 | errBuff, outBuff := bytes.NewBuffer(nil), bytes.NewBuffer(nil) |
nothing calls this directly
no test coverage detected