MCPcopy Index your code
hub / github.com/codechenx/FastTableViewer / TestStringContains

Function TestStringContains

search_test.go:128–150  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

126}
127
128func TestStringContains(t *testing.T) {
129 tests := []struct {
130 s string
131 substr string
132 expected bool
133 }{
134 {"hello world", "world", true},
135 {"hello world", "Hello", false},
136 {"hello world", "o w", true},
137 {"hello world", "", true},
138 {"hello", "hello world", false},
139 {"", "test", false},
140 {"", "", true},
141 }
142
143 for _, test := range tests {
144 result := strings.Contains(test.s, test.substr)
145 if result != test.expected {
146 t.Errorf("strings.Contains(%q, %q) = %v, want %v",
147 test.s, test.substr, result, test.expected)
148 }
149 }
150}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected