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

Function TestLazyWithErrorOK

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

Source from the content-addressed store, hash-verified

10)
11
12func TestLazyWithErrorOK(t *testing.T) {
13 t.Parallel()
14
15 l := lazy.NewWithError(func() (int, error) {
16 return 1, nil
17 })
18
19 i, err := l.Load()
20 require.NoError(t, err)
21 require.Equal(t, 1, i)
22}
23
24func TestLazyWithErrorErr(t *testing.T) {
25 t.Parallel()

Callers

nothing calls this directly

Calls 3

NewWithErrorFunction · 0.92
LoadMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected