underscore/last_test.go
Ruidy fb517f3b04
last function (#17)
* last function

* fix CI

Co-authored-by: Ruidy <rnemausat@newstore.com>
2022-03-21 18:04:30 +01:00

15 lines
244 B
Go

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