(t *testing.T)
| 1152 | } |
| 1153 | |
| 1154 | func 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 | |
| 1178 | func TestSet_PositionalArgAndFlagSameValue(t *testing.T) { |
| 1179 | tmpDir := createSetTestFiles(t) |
nothing calls this directly
no test coverage detected