(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestWrap(t *testing.T) { |
| 38 | tests := []struct { |
| 39 | err error |
| 40 | message string |
| 41 | want string |
| 42 | }{ |
| 43 | {io.EOF, "read error", "read error: EOF"}, |
| 44 | {Wrap(io.EOF, "read error"), "client error", "client error: read error: EOF"}, |
| 45 | } |
| 46 | |
| 47 | for _, tt := range tests { |
| 48 | got := Wrap(tt.err, tt.message).Error() |
| 49 | if got != tt.want { |
| 50 | t.Errorf("Wrap(%v, %q): got: %v, want %v", tt.err, tt.message, got, tt.want) |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | type nilError struct{} |
| 56 |