(t *testing.T)
| 157 | } |
| 158 | |
| 159 | func TestWithStack(t *testing.T) { |
| 160 | tests := []struct { |
| 161 | err error |
| 162 | want string |
| 163 | }{ |
| 164 | {io.EOF, "EOF"}, |
| 165 | {WithStack(io.EOF), "EOF"}, |
| 166 | } |
| 167 | |
| 168 | for _, tt := range tests { |
| 169 | got := WithStack(tt.err).Error() |
| 170 | if got != tt.want { |
| 171 | t.Errorf("WithStack(%v): got: %v, want %v", tt.err, got, tt.want) |
| 172 | } |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | func TestWithMessageNil(t *testing.T) { |
| 177 | got := WithMessage(nil, "no error") |