| 133 | } |
| 134 | |
| 135 | func TestErrorf(t *testing.T) { |
| 136 | tests := []struct { |
| 137 | err error |
| 138 | want string |
| 139 | }{ |
| 140 | {Errorf("read error without format specifiers"), "read error without format specifiers"}, |
| 141 | {Errorf("read error with %d format specifier", 1), "read error with 1 format specifier"}, |
| 142 | } |
| 143 | |
| 144 | for _, tt := range tests { |
| 145 | got := tt.err.Error() |
| 146 | if got != tt.want { |
| 147 | t.Errorf("Errorf(%v): got: %q, want %q", tt.err, got, tt.want) |
| 148 | } |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | func TestWithStackNil(t *testing.T) { |
| 153 | got := WithStack(nil) |