MCPcopy Index your code
hub / github.com/cli/cli / TestNoneUnwrap

Function TestNoneUnwrap

pkg/option/option_test.go:128–135  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

126}
127
128func TestNoneUnwrap(t *testing.T) {
129 defer func() {
130 require.Equal(t, fmt.Sprint(recover()), "called `Option.Unwrap()` on a `None` value")
131 }()
132
133 o.None[string]().Unwrap()
134 t.Error("did not panic")
135}
136
137func TestSomeUnwrapOr(t *testing.T) {
138 require.Equal(t, o.Some(42).UnwrapOr(3), 42)

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.80
UnwrapMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected