MCPcopy Create free account
hub / github.com/a-h/lexical / TestStringInsensitive

Function TestStringInsensitive

parse/string_test.go:62–131  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func TestStringInsensitive(t *testing.T) {
63 tests := []struct {
64 input string
65 s string
66 expected bool
67 expectedIndex int64
68 }{
69 {
70 input: "ABC",
71 s: "ABC",
72 expected: true,
73 expectedIndex: 3,
74 },
75 {
76 input: "ABC",
77 s: "AB",
78 expected: true,
79 expectedIndex: 2,
80 },
81 {
82 input: "ABC",
83 s: "DEF",
84 expected: false,
85 expectedIndex: 0,
86 },
87 {
88 input: "ABC",
89 s: "BCD",
90 expected: false,
91 expectedIndex: 0,
92 },
93 {
94 input: "ABD",
95 s: "ABC",
96 expected: false,
97 expectedIndex: 0,
98 },
99 {
100 input: "abc",
101 s: "ABC",
102 expected: true,
103 expectedIndex: 3,
104 },
105 {
106 input: "aBc",
107 s: "ABC",
108 expected: true,
109 expectedIndex: 3,
110 },
111 {
112 input: "aBc",
113 s: "AbC",
114 expected: true,
115 expectedIndex: 3,
116 },
117 }
118
119 for i, test := range tests {

Callers

nothing calls this directly

Calls 3

NewFromStringFunction · 0.92
StringInsensitiveFunction · 0.85
IndexMethod · 0.65

Tested by

no test coverage detected