MCPcopy
hub / github.com/pingcap/tidb / CheckNotContain

Method CheckNotContain

pkg/testkit/result.go:188–208  ·  view source on GitHub ↗

CheckNotContain checks whether the result doesn't contain the expected string

(unexpected string)

Source from the content-addressed store, hash-verified

186
187// CheckNotContain checks whether the result doesn't contain the expected string
188func (res *Result) CheckNotContain(unexpected string) {
189 found := false
190 var result string
191 for i, row := range res.rows {
192 if i > 0 {
193 result += "\n"
194 }
195 for _, colValue := range row {
196 if strings.Contains(colValue, unexpected) {
197 found = true
198 }
199 if result == "" {
200 result = colValue
201 } else {
202 result = result + " " + colValue
203 }
204 }
205 }
206 comment := fmt.Sprintf("%s\nthe result contain the unexepected '%s':\n%s", res.comment, unexpected, result)
207 res.require.Equal(false, found, comment)
208}
209
210// MultiCheckNotContain checks whether the result doesn't contain the strings in `expected`
211func (res *Result) MultiCheckNotContain(unexpecteds []string) {

Calls 2

ContainsMethod · 0.65
EqualMethod · 0.65