mirror of
https://github.com/IBM/fp-go.git
synced 2025-07-17 01:32:23 +02:00
fix: more tests
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
@ -16,21 +16,13 @@
|
||||
package option
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
TST "github.com/IBM/fp-go/internal/testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestSequenceRecord(t *testing.T) {
|
||||
assert.Equal(t, Of(map[string]string{
|
||||
"a": "A",
|
||||
"b": "B",
|
||||
}), SequenceRecord(map[string]Option[string]{
|
||||
"a": Of("A"),
|
||||
"b": Of("B"),
|
||||
}))
|
||||
}
|
||||
|
||||
func TestCompactRecord(t *testing.T) {
|
||||
// make the map
|
||||
m := make(map[string]Option[int])
|
||||
@ -45,3 +37,18 @@ func TestCompactRecord(t *testing.T) {
|
||||
|
||||
assert.Equal(t, exp, m1)
|
||||
}
|
||||
|
||||
func TestSequenceRecord(t *testing.T) {
|
||||
|
||||
s := TST.SequenceRecordTest(
|
||||
FromStrictEquals[bool](),
|
||||
Pointed[string](),
|
||||
Pointed[bool](),
|
||||
Functor[map[string]string, bool](),
|
||||
SequenceRecord[string, string],
|
||||
)
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
t.Run(fmt.Sprintf("TestSequenceRecord %d", i), s(i))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user