(t *testing.T)
| 153 | } |
| 154 | |
| 155 | func TestStringFixedDistanceStringFilter(t *testing.T) { |
| 156 | filter := stringFixedDistanceStringFilter("abc", 2, 3) |
| 157 | if filter == nil { |
| 158 | t.Fatal("expected filter") |
| 159 | } |
| 160 | |
| 161 | candidateByteIndex, ok := filter("é12abc", 0) |
| 162 | if !ok { |
| 163 | t.Fatal("expected candidate") |
| 164 | } |
| 165 | if got, want := candidateByteIndex, 2; got != want { |
| 166 | t.Fatalf("candidateByteIndex = %d, want %d", got, want) |
| 167 | } |
| 168 | |
| 169 | if _, ok := filter("é12ab", 0); ok { |
| 170 | t.Fatal("unexpected candidate for missing literal") |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | func TestStringFixedDistanceStringFilterLongLiteral(t *testing.T) { |
| 175 | if filter := stringFixedDistanceStringFilter("aaaaaaaaa", 0, 9); filter != nil { |
nothing calls this directly
no test coverage detected