lnd/fn/result_test.go

20 lines
338 B
Go
Raw Normal View History

2024-08-12 12:03:56 -07:00
package fn
import (
"errors"
2024-08-12 12:03:56 -07:00
"testing"
"github.com/stretchr/testify/require"
)
func TestResultUnwrapOrFail(t *testing.T) {
require.Equal(t, Ok(1).UnwrapOrFail(t), 1)
}
func TestOkToSome(t *testing.T) {
require.Equal(t, Ok(1).OkToSome(), Some(1))
require.Equal(
t, Err[uint8](errors.New("err")).OkToSome(), None[uint8](),
)
}