MCPcopy Create free account
hub / github.com/driangle/taskmd / TestCommitMsg_ShortFlag

Function TestCommitMsg_ShortFlag

apps/cli/internal/cli/commit_msg_test.go:285–304  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

283}
284
285func 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
306func TestCommitMsg_ShortWithBody(t *testing.T) {
307 tmpDir := createCommitMsgTestFiles(t)

Callers

nothing calls this directly

Calls 3

createCommitMsgTestFilesFunction · 0.85
resetCommitMsgFlagsFunction · 0.85
captureCommitMsgOutputFunction · 0.85

Tested by

no test coverage detected