(t *testing.T)
| 327 | } |
| 328 | |
| 329 | func TestString_Contains(t *testing.T) { |
| 330 | cases := []struct { |
| 331 | name string |
| 332 | str string |
| 333 | value string |
| 334 | wantContains chainResult |
| 335 | wantContainsFold chainResult |
| 336 | }{ |
| 337 | { |
| 338 | name: "contains", |
| 339 | str: "11-foo-22", |
| 340 | value: "foo", |
| 341 | wantContains: success, |
| 342 | wantContainsFold: success, |
| 343 | }, |
| 344 | { |
| 345 | name: "not contains", |
| 346 | str: "11-foo-22", |
| 347 | value: "bar", |
| 348 | wantContains: failure, |
| 349 | wantContainsFold: failure, |
| 350 | }, |
| 351 | { |
| 352 | name: "different case", |
| 353 | str: "11-foo-22", |
| 354 | value: "FOO", |
| 355 | wantContains: failure, |
| 356 | wantContainsFold: success, |
| 357 | }, |
| 358 | } |
| 359 | |
| 360 | for _, tc := range cases { |
| 361 | reporter := newMockReporter(t) |
| 362 | |
| 363 | NewString(reporter, tc.str).Contains(tc.value). |
| 364 | chain.assert(t, tc.wantContains) |
| 365 | NewString(reporter, tc.str).NotContains(tc.value). |
| 366 | chain.assert(t, !tc.wantContains) |
| 367 | |
| 368 | NewString(reporter, tc.str).ContainsFold(tc.value). |
| 369 | chain.assert(t, tc.wantContainsFold) |
| 370 | NewString(reporter, tc.str).NotContainsFold(tc.value). |
| 371 | chain.assert(t, !tc.wantContainsFold) |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | func TestString_HasPrefix(t *testing.T) { |
| 376 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…