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

Function TestAdd_SpecialCharactersInTitle

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

Source from the content-addressed store, hash-verified

263}
264
265func TestAdd_SpecialCharactersInTitle(t *testing.T) {
266 tmpDir := t.TempDir()
267 resetAddFlags()
268 taskDir = tmpDir
269
270 _, err := captureAddOutput(t, "Fix bug: login/auth (urgent!)")
271 if err != nil {
272 t.Fatalf("unexpected error: %v", err)
273 }
274
275 files, _ := filepath.Glob(filepath.Join(tmpDir, "001-*.md"))
276 if len(files) != 1 {
277 t.Fatalf("expected 1 file, got %d", len(files))
278 }
279
280 filename := filepath.Base(files[0])
281 // Slug should only contain lowercase alphanumeric and hyphens
282 if strings.ContainsAny(filename, ":/(!)") {
283 t.Errorf("filename should not contain special chars, got: %s", filename)
284 }
285}
286
287func TestAdd_EmptyDirectory(t *testing.T) {
288 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 2

resetAddFlagsFunction · 0.85
captureAddOutputFunction · 0.85

Tested by

no test coverage detected