(t *testing.T)
| 230 | } |
| 231 | |
| 232 | func TestStringFixedDistanceSetFilter(t *testing.T) { |
| 233 | filter := stringFixedDistanceSetFilter(syntax.FixedDistanceSet{ |
| 234 | Range: &syntax.SingleRange{First: 'a', Last: 'c'}, |
| 235 | Distance: 2, |
| 236 | }, 3) |
| 237 | if filter == nil { |
| 238 | t.Fatal("expected filter") |
| 239 | } |
| 240 | |
| 241 | candidateByteIndex, ok := filter("é12b", 0) |
| 242 | if !ok { |
| 243 | t.Fatal("expected candidate") |
| 244 | } |
| 245 | if got, want := candidateByteIndex, 2; got != want { |
| 246 | t.Fatalf("candidateByteIndex = %d, want %d", got, want) |
| 247 | } |
| 248 | if _, ok := filter("é12z", 0); ok { |
| 249 | t.Fatal("unexpected candidate") |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | func TestStringFixedDistanceSetFilterSmallSet(t *testing.T) { |
| 254 | filter := stringFixedDistanceSetFilter(syntax.FixedDistanceSet{ |
nothing calls this directly
no test coverage detected