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

Function TestSplitFilenameID_UUIDPatterns

sdk/go/parser/markdown_test.go:642–666  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

640}
641
642func TestSplitFilenameID_UUIDPatterns(t *testing.T) {
643 tests := []struct {
644 name string
645 input string
646 wantID string
647 wantSlug string
648 }{
649 {"truncated 8-char hex", "f47ac10b-fix-bug", "f47ac10b", "fix-bug"},
650 {"long hex 12 chars", "f47ac10b58cc-slug", "f47ac10b58cc", "slug"},
651 {"full UUID with slug", "f47ac10b-58cc-4372-a567-0e02b2c3d479-slug", "f47ac10b-58cc-4372-a567-0e02b2c3d479", "slug"},
652 {"full UUID no slug", "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", ""},
653 }
654
655 for _, tt := range tests {
656 t.Run(tt.name, func(t *testing.T) {
657 id, slug := splitFilenameID(tt.input)
658 if id != tt.wantID {
659 t.Errorf("splitFilenameID(%q) id = %q, want %q", tt.input, id, tt.wantID)
660 }
661 if slug != tt.wantSlug {
662 t.Errorf("splitFilenameID(%q) slug = %q, want %q", tt.input, slug, tt.wantSlug)
663 }
664 })
665 }
666}
667
668func TestIsHexID(t *testing.T) {
669 tests := []struct {

Callers

nothing calls this directly

Calls 1

splitFilenameIDFunction · 0.85

Tested by

no test coverage detected