(t *testing.T)
| 3372 | } |
| 3373 | |
| 3374 | func TestNotErrorAs(t *testing.T) { |
| 3375 | tests := []struct { |
| 3376 | err error |
| 3377 | result bool |
| 3378 | }{ |
| 3379 | {fmt.Errorf("wrap: %w", &customError{}), false}, |
| 3380 | {io.EOF, true}, |
| 3381 | {nil, true}, |
| 3382 | } |
| 3383 | for _, tt := range tests { |
| 3384 | tt := tt |
| 3385 | var target *customError |
| 3386 | t.Run(fmt.Sprintf("NotErrorAs(%#v,%#v)", tt.err, target), func(t *testing.T) { |
| 3387 | mockT := new(testing.T) |
| 3388 | res := NotErrorAs(mockT, tt.err, &target) |
| 3389 | if res != tt.result { |
| 3390 | t.Errorf("NotErrorAs(%#v,%#v) should not return %t", tt.err, target, tt.result) |
| 3391 | } |
| 3392 | if res == mockT.Failed() { |
| 3393 | t.Errorf("The test result (%t) should be reflected in the testing.T type (%t)", res, !mockT.Failed()) |
| 3394 | } |
| 3395 | }) |
| 3396 | } |
| 3397 | } |
nothing calls this directly
no test coverage detected