CheckNotContain checks whether the result doesn't contain the expected string
(unexpected string)
| 186 | |
| 187 | // CheckNotContain checks whether the result doesn't contain the expected string |
| 188 | func (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` |
| 211 | func (res *Result) MultiCheckNotContain(unexpecteds []string) { |