(t *testing.T)
| 126 | } |
| 127 | |
| 128 | func 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 | |
| 137 | func TestSomeUnwrapOr(t *testing.T) { |
| 138 | require.Equal(t, o.Some(42).UnwrapOr(3), 42) |