underscore/sum_test.go
Ruidy 482e553263
sum (#13)
Co-authored-by: Ruidy <rnemausat@newstore.com>
2022-02-20 15:34:09 +01:00

15 lines
246 B
Go

package underscore_test
import (
"testing"
u "github.com/rjNemo/underscore"
"github.com/stretchr/testify/assert"
)
func TestSum(t *testing.T) {
nums := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
want := 45
assert.Equal(t, want, u.Sum(nums))
}