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

Function TestSet_PositionalArg

apps/cli/internal/cli/set_test.go:1154–1176  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1152}
1153
1154func TestSet_PositionalArg(t *testing.T) {
1155 tmpDir := createSetTestFiles(t)
1156 resetSetFlags()
1157 taskDir = tmpDir
1158 setStatus = "completed"
1159
1160 output, err := captureSetOutputWithArgs(t, []string{"001"})
1161 if err != nil {
1162 t.Fatalf("unexpected error: %v", err)
1163 }
1164
1165 if !strings.Contains(output, "Updated task 001") {
1166 t.Error("Expected confirmation message")
1167 }
1168 if !strings.Contains(output, "status: pending -> completed") {
1169 t.Errorf("Expected status change in output, got: %s", output)
1170 }
1171
1172 content, _ := os.ReadFile(filepath.Join(tmpDir, "001-setup.md"))
1173 if !strings.Contains(string(content), "status: completed") {
1174 t.Error("Expected file to contain updated status")
1175 }
1176}
1177
1178func TestSet_PositionalArgAndFlagSameValue(t *testing.T) {
1179 tmpDir := createSetTestFiles(t)

Callers

nothing calls this directly

Calls 4

createSetTestFilesFunction · 0.85
resetSetFlagsFunction · 0.85
captureSetOutputWithArgsFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected