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

Function TestChangeSegment

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

Source from the content-addressed store, hash-verified

1145}
1146
1147func TestChangeSegment(t *testing.T) {
1148 tests := []struct {
1149 verb string
1150 tasks []*model.Task
1151 want string
1152 }{
1153 {"complete", []*model.Task{{ID: "042"}}, "complete task 042"},
1154 {"complete", []*model.Task{{ID: "042"}, {ID: "043"}}, "complete tasks 042, 043"},
1155 {"add", []*model.Task{{ID: "045"}}, "add task 045"},
1156 {"start", []*model.Task{{ID: "047"}, {ID: "048"}}, "start tasks 047, 048"},
1157 }
1158
1159 for _, tt := range tests {
1160 t.Run(tt.want, func(t *testing.T) {
1161 got := changeSegment(tt.verb, tt.tasks)
1162 if got != tt.want {
1163 t.Errorf("changeSegment() = %q, want %q", got, tt.want)
1164 }
1165 })
1166 }
1167}

Callers

nothing calls this directly

Calls 1

changeSegmentFunction · 0.85

Tested by

no test coverage detected