MCPcopy
hub / github.com/minio/minio-go / TestDoErr

Function TestDoErr

pkg/singleflight/singleflight_test.go:98–110  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

96}
97
98func TestDoErr(t *testing.T) {
99 var g Group[string, any]
100 someErr := errors.New("Some error")
101 v, err, _ := g.Do("key", func() (any, error) {
102 return nil, someErr
103 })
104 if err != someErr {
105 t.Errorf("Do error = %v; want someErr %v", err, someErr)
106 }
107 if v != nil {
108 t.Errorf("unexpected non-nil value %#v", v)
109 }
110}
111
112func TestDoDupSuppress(t *testing.T) {
113 var g Group[string, any]

Callers

nothing calls this directly

Calls 1

DoMethod · 0.80

Tested by

no test coverage detected