Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Jul 3, 2022
1 parent 828393e commit f1f9d18
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions func_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package lo

import (
"strconv"
"testing"

"github.com/stretchr/testify/assert"
)

func TestBind(t *testing.T) {
func TestPartial(t *testing.T) {
is := assert.New(t)

add := func(x, y int) int { return x + y }
f := Bind(add, 5)
is.Equal(15, f(10))
is.Equal(0, f(-5))
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))
}

0 comments on commit f1f9d18

Please sign in to comment.