MCPcopy Create free account
hub / github.com/dlclark/regexp2 / TestStringFixedDistanceSetFilterSmallSet

Function TestStringFixedDistanceSetFilterSmallSet

stringprefixfilter_test.go:312–322  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

310}
311
312func TestStringFixedDistanceSetFilterSmallSet(t *testing.T) {
313 filter := stringFixedDistanceSetFilter(syntax.FixedDistanceSet{
314 Chars: []rune{'a', 'c'},
315 }, 1)
316 if filter == nil {
317 t.Fatal("expected filter")
318 }
319 if got, ok := filter("zzc", 0); !ok || got != 2 {
320 t.Fatalf("filter = %d, %v; want 2, true", got, ok)
321 }
322}
323
324func TestStringFixedDistanceSetFilterRejectsUnsupportedSets(t *testing.T) {
325 for _, set := range []syntax.FixedDistanceSet{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected