(t *testing.T)
| 3880 | } |
| 3881 | |
| 3882 | func TestNotErrorAs(t *testing.T) { |
| 3883 | t.Parallel() |
| 3884 | |
| 3885 | tests := []struct { |
| 3886 | err error |
| 3887 | result bool |
| 3888 | resultErrMsg string |
| 3889 | }{ |
| 3890 | { |
| 3891 | err: fmt.Errorf("wrap: %w", &customError{}), |
| 3892 | result: false, |
| 3893 | resultErrMsg: "" + |
| 3894 | "Target error should not be in err chain:\n" + |
| 3895 | "found: *assert.customError\n" + |
| 3896 | "in chain: \"wrap: fail\" (*fmt.wrapError)\n" + |
| 3897 | "\t\"fail\" (*assert.customError)\n", |
| 3898 | }, |
| 3899 | { |
| 3900 | err: io.EOF, |
| 3901 | result: true, |
| 3902 | }, |
| 3903 | { |
| 3904 | err: nil, |
| 3905 | result: true, |
| 3906 | }, |
| 3907 | } |
| 3908 | for _, tt := range tests { |
| 3909 | tt := tt |
| 3910 | var target *customError |
| 3911 | t.Run(fmt.Sprintf("NotErrorAs(%#v,%#v)", tt.err, target), func(t *testing.T) { |
| 3912 | mockT := new(captureTestingT) |
| 3913 | res := NotErrorAs(mockT, tt.err, &target) |
| 3914 | mockT.checkResultAndErrMsg(t, tt.result, res, tt.resultErrMsg) |
| 3915 | }) |
| 3916 | } |
| 3917 | } |
nothing calls this directly
no test coverage detected