feat(mutable): shuffle

This commit is contained in:
Samuel Berthe
2025-01-26 00:02:51 +01:00
parent 64e89e4766
commit 699707a0db
5 changed files with 45 additions and 11 deletions

View File

@@ -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)