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

Function TestStringFixedDistanceSetFilterSmallSet

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

Source from the content-addressed store, hash-verified

251}
252
253func TestStringFixedDistanceSetFilterSmallSet(t *testing.T) {
254 filter := stringFixedDistanceSetFilter(syntax.FixedDistanceSet{
255 Chars: []rune{'a', 'c'},
256 }, 1)
257 if filter == nil {
258 t.Fatal("expected filter")
259 }
260 if got, ok := filter("zzc", 0); !ok || got != 2 {
261 t.Fatalf("filter = %d, %v; want 2, true", got, ok)
262 }
263}
264
265func TestStringFixedDistanceSetFilterRejectsUnsupportedSets(t *testing.T) {
266 for _, set := range []syntax.FixedDistanceSet{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected