(t *testing.T)
| 219 | } |
| 220 | |
| 221 | func TestString_IsEqual(t *testing.T) { |
| 222 | cases := []struct { |
| 223 | name string |
| 224 | str string |
| 225 | value string |
| 226 | wantEqual chainResult |
| 227 | wantEqualFold chainResult |
| 228 | }{ |
| 229 | { |
| 230 | name: "equivalent string", |
| 231 | str: "foo", |
| 232 | value: "foo", |
| 233 | wantEqual: success, |
| 234 | wantEqualFold: success, |
| 235 | }, |
| 236 | { |
| 237 | name: "non-equivalent string", |
| 238 | str: "foo", |
| 239 | value: "bar", |
| 240 | wantEqual: failure, |
| 241 | wantEqualFold: failure, |
| 242 | }, |
| 243 | { |
| 244 | name: "different case", |
| 245 | str: "foo", |
| 246 | value: "FOO", |
| 247 | wantEqual: failure, |
| 248 | wantEqualFold: success, |
| 249 | }, |
| 250 | } |
| 251 | |
| 252 | for _, tc := range cases { |
| 253 | reporter := newMockReporter(t) |
| 254 | |
| 255 | NewString(reporter, tc.str).IsEqual(tc.value). |
| 256 | chain.assert(t, tc.wantEqual) |
| 257 | NewString(reporter, tc.str).NotEqual(tc.value). |
| 258 | chain.assert(t, !tc.wantEqual) |
| 259 | |
| 260 | NewString(reporter, tc.str).IsEqualFold(tc.value). |
| 261 | chain.assert(t, tc.wantEqualFold) |
| 262 | NewString(reporter, tc.str).NotEqualFold(tc.value). |
| 263 | chain.assert(t, !tc.wantEqualFold) |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | func TestString_InList(t *testing.T) { |
| 268 | t.Run("basic", func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…