MCPcopy
hub / github.com/duke-git/lancet / TestOrElseGetHappyPath

Function TestOrElseGetHappyPath

datastructure/optional/optional_test.go:53–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func TestOrElseGetHappyPath(t *testing.T) {
54 assert := internal.NewAssert(t, "TestOrElseGetHappyPath")
55 optWithValue := Of(42)
56 action := func() int { return 100 }
57
58 val := optWithValue.OrElseGet(action)
59 assert.Equal(val, 42)
60}
61
62func TestOrElseGet(t *testing.T) {
63 assert := internal.NewAssert(t, "TestOrElseGet")

Callers

nothing calls this directly

Calls 4

EqualMethod · 0.95
NewAssertFunction · 0.92
OrElseGetMethod · 0.80
OfFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…