(t *testing.T)
| 2609 | } |
| 2610 | |
| 2611 | func TestValueAssertionFunc(t *testing.T) { |
| 2612 | tests := []struct { |
| 2613 | name string |
| 2614 | value interface{} |
| 2615 | assertion ValueAssertionFunc |
| 2616 | }{ |
| 2617 | {"notNil", true, NotNil}, |
| 2618 | {"nil", nil, Nil}, |
| 2619 | {"empty", []int{}, Empty}, |
| 2620 | {"notEmpty", []int{1}, NotEmpty}, |
| 2621 | {"zero", false, Zero}, |
| 2622 | {"notZero", 42, NotZero}, |
| 2623 | } |
| 2624 | |
| 2625 | for _, tt := range tests { |
| 2626 | t.Run(tt.name, func(t *testing.T) { |
| 2627 | tt.assertion(t, tt.value) |
| 2628 | }) |
| 2629 | } |
| 2630 | } |
| 2631 | |
| 2632 | func ExampleBoolAssertionFunc() { |
| 2633 | t := &testing.T{} // provided by test |
nothing calls this directly
no test coverage detected
searching dependent graphs…