(t *testing.T)
| 640 | } |
| 641 | |
| 642 | func 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 | |
| 668 | func TestIsHexID(t *testing.T) { |
| 669 | tests := []struct { |
nothing calls this directly
no test coverage detected