(t *testing.T)
| 18 | } |
| 19 | |
| 20 | func TestErrorf(t *testing.T) { |
| 21 | err := Errorf("%w", fs.ErrNotExist) |
| 22 | |
| 23 | if got, want := err.Error(), "file does not exist"; got != want { |
| 24 | t.Errorf("Errorf().Error() = %q, want %q", got, want) |
| 25 | } |
| 26 | |
| 27 | // ensure error wrapping still works |
| 28 | if !errors.Is(err, fs.ErrNotExist) { |
| 29 | t.Errorf("error chain does not contain fs.ErrNotExist") |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | func TestAs(t *testing.T) { |
| 34 | verr := New("visible error") |