mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 14:40:30 +01:00
19 lines
338 B
Go
19 lines
338 B
Go
package fn
|
|
|
|
import (
|
|
"errors"
|
|
"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](),
|
|
)
|
|
}
|