(t *testing.T)
| 178 | } |
| 179 | |
| 180 | func TestStringFixedDistanceCharFilter(t *testing.T) { |
| 181 | filter := stringFixedDistanceCharFilter('a', 2, 3) |
| 182 | if filter == nil { |
| 183 | t.Fatal("expected filter") |
| 184 | } |
| 185 | |
| 186 | candidateByteIndex, ok := filter("é12a", 0) |
| 187 | if !ok { |
| 188 | t.Fatal("expected candidate") |
| 189 | } |
| 190 | if got, want := candidateByteIndex, 2; got != want { |
| 191 | t.Fatalf("candidateByteIndex = %d, want %d", got, want) |
| 192 | } |
| 193 | |
| 194 | if _, ok := filter("xyz", 0); ok { |
| 195 | t.Fatal("unexpected candidate for missing char") |
| 196 | } |
| 197 | |
| 198 | if _, ok := filter("xyz", 0); ok { |
| 199 | t.Fatal("unexpected candidate for missing char") |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | func TestStringFixedDistanceCharFilterCandidateBeforeStart(t *testing.T) { |
| 204 | filter := stringFixedDistanceCharFilter('a', 2, 1) |
nothing calls this directly
no test coverage detected