MCPcopy
hub / github.com/docker/docker-agent / TestWrapErrorsFlagsVerbOnError

Function TestWrapErrorsFlagsVerbOnError

lint/wrap_errors_test.go:11–20  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestWrapErrorsFlagsVerbOnError(t *testing.T) {
12 t.Parallel()
13 src := `package p
14import "fmt"
15func f(err error) error { return fmt.Errorf("oops: %v", err) }
16`
17 offenses := coptest.RunTyped(t, WrapErrors, src)
18 require.Len(t, offenses, 1)
19 assert.Equal(t, "Lint/WrapErrors", offenses[0].CopName)
20}
21
22func TestWrapErrorsAllowsWrapVerb(t *testing.T) {
23 t.Parallel()

Callers

nothing calls this directly

Calls 1

LenMethod · 0.65

Tested by

no test coverage detected