(t *testing.T)
| 199 | } |
| 200 | |
| 201 | func TestFeedCommand_Limit(t *testing.T) { |
| 202 | resetFeedFlags() |
| 203 | feedLimit = 5 |
| 204 | |
| 205 | var capturedArgs []string |
| 206 | oldGitLog := gitLogFunc |
| 207 | gitLogFunc = func(_ string, args []string) (string, error) { |
| 208 | capturedArgs = args |
| 209 | return "", nil |
| 210 | } |
| 211 | defer func() { gitLogFunc = oldGitLog }() |
| 212 | |
| 213 | oldGitShow := gitShowFunc |
| 214 | gitShowFunc = noopGitShow |
| 215 | defer func() { gitShowFunc = oldGitShow }() |
| 216 | |
| 217 | _, err := captureFeedOutput(t, func() error { |
| 218 | return runFeed(feedCmd, nil) |
| 219 | }) |
| 220 | if err != nil { |
| 221 | t.Fatalf("unexpected error: %v", err) |
| 222 | } |
| 223 | |
| 224 | found := false |
| 225 | for _, arg := range capturedArgs { |
| 226 | if arg == "-5" { |
| 227 | found = true |
| 228 | break |
| 229 | } |
| 230 | } |
| 231 | if !found { |
| 232 | t.Errorf("expected -5 in git args, got: %v", capturedArgs) |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | func TestFeedCommand_Since(t *testing.T) { |
| 237 | resetFeedFlags() |
nothing calls this directly
no test coverage detected