(t *testing.T)
| 438 | } |
| 439 | |
| 440 | func TestCommitMsg_AutoInferFromDiff(t *testing.T) { |
| 441 | tmpDir := createCommitMsgTestFiles(t) |
| 442 | resetCommitMsgFlags() |
| 443 | taskDir = tmpDir |
| 444 | |
| 445 | mockGitDiffAndRoot(t, |
| 446 | "diff --git a/cli/042-feature.md b/cli/042-feature.md\n"+ |
| 447 | "+++ b/cli/042-feature.md\n"+ |
| 448 | "@@ -4 +4 @@\n"+ |
| 449 | "-status: pending\n"+ |
| 450 | "+status: completed\n", |
| 451 | tmpDir) |
| 452 | |
| 453 | output, err := captureCommitMsgOutput(t) |
| 454 | if err != nil { |
| 455 | t.Fatalf("unexpected error: %v", err) |
| 456 | } |
| 457 | |
| 458 | if !strings.Contains(output, "chore(cli): add commit-msg command (task 042)") { |
| 459 | t.Errorf("expected auto-detected task message with ID in header, got:\n%s", output) |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | func TestCommitMsg_EmptyDiff(t *testing.T) { |
| 464 | tmpDir := createCommitMsgTestFiles(t) |
nothing calls this directly
no test coverage detected