Files
lo/func_test.go
2022-10-02 21:38:26 +02:00

21 lines
300 B
Go

package lo
import (
"strconv"
"testing"
"github.com/stretchr/testify/assert"
)
func TestPartial(t *testing.T) {
t.Parallel()
is := assert.New(t)
add := func(x float64, y int) string {
return strconv.Itoa(int(x) + y)
}
f := Partial(add, 5)
is.Equal("15", f(10))
is.Equal("0", f(-5))
}