MCPcopy
hub / github.com/rclone/rclone / TestContextError

Function TestContextError

fs/fserrors/error_test.go:162–178  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

160}
161
162func TestContextError(t *testing.T) {
163 var err = io.EOF
164 ctx, cancel := context.WithCancel(context.Background())
165
166 assert.False(t, ContextError(ctx, &err))
167 assert.Equal(t, io.EOF, err)
168
169 cancel()
170
171 assert.True(t, ContextError(ctx, &err))
172 assert.Equal(t, io.EOF, err)
173
174 err = nil
175
176 assert.True(t, ContextError(ctx, &err))
177 assert.Equal(t, context.Canceled, err)
178}

Callers

nothing calls this directly

Calls 2

ContextErrorFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…