(t *testing.T)
| 289 | } |
| 290 | |
| 291 | func TestStringFixedDistanceSetFilter(t *testing.T) { |
| 292 | filter := stringFixedDistanceSetFilter(syntax.FixedDistanceSet{ |
| 293 | Range: &syntax.SingleRange{First: 'a', Last: 'c'}, |
| 294 | Distance: 2, |
| 295 | }, 3) |
| 296 | if filter == nil { |
| 297 | t.Fatal("expected filter") |
| 298 | } |
| 299 | |
| 300 | candidateByteIndex, ok := filter("é12b", 0) |
| 301 | if !ok { |
| 302 | t.Fatal("expected candidate") |
| 303 | } |
| 304 | if got, want := candidateByteIndex, 2; got != want { |
| 305 | t.Fatalf("candidateByteIndex = %d, want %d", got, want) |
| 306 | } |
| 307 | if _, ok := filter("é12z", 0); ok { |
| 308 | t.Fatal("unexpected candidate") |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | func TestStringFixedDistanceSetFilterSmallSet(t *testing.T) { |
| 313 | filter := stringFixedDistanceSetFilter(syntax.FixedDistanceSet{ |
nothing calls this directly
no test coverage detected