(t *testing.T)
| 2548 | } |
| 2549 | |
| 2550 | func TestComparisonAssertionFunc(t *testing.T) { |
| 2551 | type iface interface { |
| 2552 | Name() string |
| 2553 | } |
| 2554 | |
| 2555 | tests := []struct { |
| 2556 | name string |
| 2557 | expect interface{} |
| 2558 | got interface{} |
| 2559 | assertion ComparisonAssertionFunc |
| 2560 | }{ |
| 2561 | {"implements", (*iface)(nil), t, Implements}, |
| 2562 | {"isType", (*testing.T)(nil), t, IsType}, |
| 2563 | {"equal", t, t, Equal}, |
| 2564 | {"equalValues", t, t, EqualValues}, |
| 2565 | {"notEqualValues", t, nil, NotEqualValues}, |
| 2566 | {"exactly", t, t, Exactly}, |
| 2567 | {"notEqual", t, nil, NotEqual}, |
| 2568 | {"notContains", []int{1, 2, 3}, 4, NotContains}, |
| 2569 | {"subset", []int{1, 2, 3, 4}, []int{2, 3}, Subset}, |
| 2570 | {"notSubset", []int{1, 2, 3, 4}, []int{0, 3}, NotSubset}, |
| 2571 | {"elementsMatch", []byte("abc"), []byte("bac"), ElementsMatch}, |
| 2572 | {"regexp", "^t.*y$", "testify", Regexp}, |
| 2573 | {"notRegexp", "^t.*y$", "Testify", NotRegexp}, |
| 2574 | } |
| 2575 | |
| 2576 | for _, tt := range tests { |
| 2577 | t.Run(tt.name, func(t *testing.T) { |
| 2578 | tt.assertion(t, tt.expect, tt.got) |
| 2579 | }) |
| 2580 | } |
| 2581 | } |
| 2582 | |
| 2583 | func ExampleValueAssertionFunc() { |
| 2584 | t := &testing.T{} // provided by test |
nothing calls this directly
no test coverage detected
searching dependent graphs…