(t *testing.T)
| 181 | } |
| 182 | |
| 183 | func TestWithMessage(t *testing.T) { |
| 184 | tests := []struct { |
| 185 | err error |
| 186 | message string |
| 187 | want string |
| 188 | }{ |
| 189 | {io.EOF, "read error", "read error: EOF"}, |
| 190 | {WithMessage(io.EOF, "read error"), "client error", "client error: read error: EOF"}, |
| 191 | } |
| 192 | |
| 193 | for _, tt := range tests { |
| 194 | got := WithMessage(tt.err, tt.message).Error() |
| 195 | if got != tt.want { |
| 196 | t.Errorf("WithMessage(%v, %q): got: %q, want %q", tt.err, tt.message, got, tt.want) |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | func TestWithMessagefNil(t *testing.T) { |
| 202 | got := WithMessagef(nil, "no error") |
nothing calls this directly
no test coverage detected
searching dependent graphs…