MCPcopy
hub / github.com/AdguardTeam/dnsproxy / TestIsEPIPE

Function TestIsEPIPE

proxy/errors_internal_test.go:14–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestIsEPIPE(t *testing.T) {
15 type testCase struct {
16 err error
17 name string
18 want bool
19 }
20
21 testCases := []testCase{{
22 name: "nil",
23 err: nil,
24 want: false,
25 }, {
26 name: "epipe",
27 err: syscall.EPIPE,
28 want: true,
29 }, {
30 name: "not_epipe",
31 err: errors.Error("test error"),
32 want: false,
33 }, {
34 name: "wrapped_epipe",
35 err: fmt.Errorf("test error: %w", syscall.EPIPE),
36 want: true,
37 }}
38
39 for _, tc := range testCases {
40 t.Run(tc.name, func(t *testing.T) {
41 got := isEPIPE(tc.err)
42 assert.Equal(t, tc.want, got)
43 })
44 }
45}

Callers

nothing calls this directly

Calls 2

isEPIPEFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…