MCPcopy
hub / github.com/tailscale/tailscale / TestErrorf

Function TestErrorf

util/vizerror/vizerror_test.go:20–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

18}
19
20func 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
33func TestAs(t *testing.T) {
34 verr := New("visible error")

Callers

nothing calls this directly

Calls 4

ErrorfFunction · 0.70
ErrorMethod · 0.65
ErrorfMethod · 0.65
IsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…