mirror of
https://github.com/IBM/fp-go.git
synced 2025-11-25 22:21:49 +02:00
initial checkin
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
29
option/sequence_test.go
Normal file
29
option/sequence_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package option
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
T "github.com/ibm/fp-go/tuple"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestSequenceT(t *testing.T) {
|
||||
// one argumemt
|
||||
s1 := SequenceT1[int]
|
||||
assert.Equal(t, Of(T.MakeTuple1(1)), s1(Of(1)))
|
||||
|
||||
// two arguments
|
||||
s2 := SequenceT2[int, string]
|
||||
assert.Equal(t, Of(T.MakeTuple2(1, "a")), s2(Of(1), Of("a")))
|
||||
|
||||
// three arguments
|
||||
s3 := SequenceT3[int, string, bool]
|
||||
assert.Equal(t, Of(T.MakeTuple3(1, "a", true)), s3(Of(1), Of("a"), Of(true)))
|
||||
|
||||
// four arguments
|
||||
s4 := SequenceT4[int, string, bool, int]
|
||||
assert.Equal(t, Of(T.MakeTuple4(1, "a", true, 2)), s4(Of(1), Of("a"), Of(true), Of(2)))
|
||||
|
||||
// three with one none
|
||||
assert.Equal(t, None[T.Tuple3[int, string, bool]](), s3(Of(1), Of("a"), None[bool]()))
|
||||
}
|
||||
Reference in New Issue
Block a user