mirror of
https://github.com/samber/lo.git
synced 2025-11-03 10:21:01 +08:00
feat(mutable): shuffle
This commit is contained in:
@@ -6,6 +6,19 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestShuffle(t *testing.T) {
|
||||
t.Parallel()
|
||||
is := assert.New(t)
|
||||
|
||||
list := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
|
||||
Shuffle(list)
|
||||
is.NotEqual(list, []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10})
|
||||
|
||||
list = []int{}
|
||||
Shuffle(list)
|
||||
is.Equal(list, []int{})
|
||||
}
|
||||
|
||||
func TestReverse(t *testing.T) {
|
||||
t.Parallel()
|
||||
is := assert.New(t)
|
||||
|
||||
Reference in New Issue
Block a user