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

Function TestStringIndexPrefixFilterASCIIIgnoreCase

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

Source from the content-addressed store, hash-verified

50}
51
52func TestStringIndexPrefixFilterASCIIIgnoreCase(t *testing.T) {
53 filter := stringIndexPrefixFilter("abc", true, 3)
54 if filter == nil {
55 t.Fatal("expected filter")
56 }
57
58 candidateByteIndex, ok := filter("xxABc", 0)
59 if !ok {
60 t.Fatal("expected candidate")
61 }
62 if got, want := candidateByteIndex, 2; got != want {
63 t.Fatalf("candidateByteIndex = %d, want %d", got, want)
64 }
65}
66
67func TestStringIndexPrefixFilterRejectsNonASCIIIgnoreCasePrefix(t *testing.T) {
68 if filter := stringIndexPrefixFilter("é", true, 1); filter != nil {

Callers

nothing calls this directly

Calls 1

stringIndexPrefixFilterFunction · 0.85

Tested by

no test coverage detected