MCPcopy Index your code
hub / github.com/coder/coder / TestLazyWithErrorErr

Function TestLazyWithErrorErr

coderd/util/lazy/valuewitherror_test.go:24–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22}
23
24func TestLazyWithErrorErr(t *testing.T) {
25 t.Parallel()
26
27 l := lazy.NewWithError(func() (int, error) {
28 return 0, xerrors.New("oh no! everything that could went horribly wrong!")
29 })
30
31 i, err := l.Load()
32 require.Error(t, err)
33 require.Equal(t, 0, i)
34}
35
36func TestLazyWithErrorPointers(t *testing.T) {
37 t.Parallel()

Callers

nothing calls this directly

Calls 5

NewWithErrorFunction · 0.92
NewMethod · 0.65
LoadMethod · 0.45
ErrorMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected