1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-08-10 22:31:32 +02:00

fix: bug in compact array

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-11-29 22:13:08 +01:00
parent 35848900c0
commit 12de469b52
4 changed files with 33 additions and 4 deletions

18
either/array_test.go Normal file
View File

@@ -0,0 +1,18 @@
package either
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestCompactArray(t *testing.T) {
ar := []Either[string, string]{
Of[string]("ok"),
Left[string]("err"),
Of[string]("ok"),
}
res := CompactArray(ar)
assert.Equal(t, 2, len(res))
}