(t *testing.T)
| 34 | } |
| 35 | |
| 36 | func TestLazyWithErrorPointers(t *testing.T) { |
| 37 | t.Parallel() |
| 38 | |
| 39 | a := 1 |
| 40 | l := lazy.NewWithError(func() (*int, error) { |
| 41 | return &a, nil |
| 42 | }) |
| 43 | |
| 44 | b, err := l.Load() |
| 45 | require.NoError(t, err) |
| 46 | c, err := l.Load() |
| 47 | require.NoError(t, err) |
| 48 | |
| 49 | *b++ |
| 50 | *c++ |
| 51 | require.Equal(t, 3, a) |
| 52 | } |
nothing calls this directly
no test coverage detected