(t *testing.T)
| 283 | } |
| 284 | |
| 285 | func TestCommitMsg_ShortFlag(t *testing.T) { |
| 286 | tmpDir := createCommitMsgTestFiles(t) |
| 287 | resetCommitMsgFlags() |
| 288 | taskDir = tmpDir |
| 289 | commitMsgTaskID = "042" |
| 290 | commitMsgShort = true |
| 291 | |
| 292 | output, err := captureCommitMsgOutput(t) |
| 293 | if err != nil { |
| 294 | t.Fatalf("unexpected error: %v", err) |
| 295 | } |
| 296 | |
| 297 | trimmed := strings.TrimSpace(output) |
| 298 | if strings.Contains(trimmed, "\n") { |
| 299 | t.Errorf("--short should produce single line, got:\n%s", output) |
| 300 | } |
| 301 | if !strings.HasPrefix(trimmed, "chore(cli):") || !strings.Contains(trimmed, "(task 042)") { |
| 302 | t.Errorf("expected subject line with task ID, got: %s", trimmed) |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | func TestCommitMsg_ShortWithBody(t *testing.T) { |
| 307 | tmpDir := createCommitMsgTestFiles(t) |
nothing calls this directly
no test coverage detected