(t *testing.T)
| 212 | } |
| 213 | |
| 214 | func TestStringFixedDistanceStringFilter(t *testing.T) { |
| 215 | filter := stringFixedDistanceStringFilter("abc", 2, 3) |
| 216 | if filter == nil { |
| 217 | t.Fatal("expected filter") |
| 218 | } |
| 219 | |
| 220 | candidateByteIndex, ok := filter("é12abc", 0) |
| 221 | if !ok { |
| 222 | t.Fatal("expected candidate") |
| 223 | } |
| 224 | if got, want := candidateByteIndex, 2; got != want { |
| 225 | t.Fatalf("candidateByteIndex = %d, want %d", got, want) |
| 226 | } |
| 227 | |
| 228 | if _, ok := filter("é12ab", 0); ok { |
| 229 | t.Fatal("unexpected candidate for missing literal") |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | func TestStringFixedDistanceStringFilterLongLiteral(t *testing.T) { |
| 234 | if filter := stringFixedDistanceStringFilter("aaaaaaaaa", 0, 9); filter != nil { |
nothing calls this directly
no test coverage detected