MCPcopy Create free account
hub / github.com/riverqueue/river / TestValOrDefault

Function TestValOrDefault

rivershared/util/ptrutil/ptr_util_test.go:23–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestValOrDefault(t *testing.T) {
24 t.Parallel()
25
26 val := "val"
27 require.Equal(t, val, ValOrDefault(&val, "default"))
28 require.Equal(t, "default", ValOrDefault((*string)(nil), "default"))
29}
30
31func TestValOrDefaultFunc(t *testing.T) {
32 t.Parallel()

Callers

nothing calls this directly

Calls 1

ValOrDefaultFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…