(t *testing.T)
| 451 | } |
| 452 | |
| 453 | func TestLevenshtein(t *testing.T) { |
| 454 | tests := []struct { |
| 455 | a, b string |
| 456 | expected int |
| 457 | }{ |
| 458 | {"", "", 0}, |
| 459 | {"abc", "", 3}, |
| 460 | {"", "abc", 3}, |
| 461 | {"abc", "abc", 0}, |
| 462 | {"abc", "abd", 1}, |
| 463 | {"kitten", "sitting", 3}, |
| 464 | } |
| 465 | |
| 466 | for _, tt := range tests { |
| 467 | result := levenshtein(tt.a, tt.b) |
| 468 | if result != tt.expected { |
| 469 | t.Errorf("levenshtein(%q, %q) = %d, expected %d", tt.a, tt.b, result, tt.expected) |
| 470 | } |
| 471 | } |
| 472 | } |
| 473 | |
| 474 | // --- File path matching tests --- |
| 475 |
nothing calls this directly
no test coverage detected