(t *testing.T)
| 681 | } |
| 682 | |
| 683 | func TestFuzzyMatchTasks(t *testing.T) { |
| 684 | tasks := []*model.Task{ |
| 685 | {ID: "001", Title: "Setup project"}, |
| 686 | {ID: "002", Title: "Implement authentication"}, |
| 687 | {ID: "003", Title: "Build UI components"}, |
| 688 | } |
| 689 | |
| 690 | // "auth" should match task 002 via substring |
| 691 | matches := fuzzyMatchTasks("auth", tasks, 0.6) |
| 692 | if len(matches) == 0 { |
| 693 | t.Fatal("Expected at least one fuzzy match for 'auth'") |
| 694 | } |
| 695 | if matches[0].Task.ID != "002" { |
| 696 | t.Errorf("Expected top match to be task 002, got %s", matches[0].Task.ID) |
| 697 | } |
| 698 | |
| 699 | // Very high threshold should filter everything |
| 700 | matches = fuzzyMatchTasks("auth", tasks, 0.99) |
| 701 | if len(matches) != 0 { |
| 702 | t.Errorf("Expected no matches with threshold 0.99, got %d", len(matches)) |
| 703 | } |
| 704 | } |
| 705 | |
| 706 | func createParentTestFiles(t *testing.T) string { |
| 707 | t.Helper() |
nothing calls this directly
no test coverage detected