sum: use slices.Equal

This commit is contained in:
vinchent 2024-09-10 21:43:55 +02:00
parent fac93ea9ec
commit 4bfd9eda4f

View File

@ -1,7 +1,7 @@
package sum
import (
"reflect"
"slices"
"testing"
)
@ -22,8 +22,7 @@ func TestSumAll(t *testing.T) {
got := SumAll([]int{1, 2}, []int{0, 9})
exp := []int{3, 9}
// NOTE: check if any two variables are the same
if !reflect.DeepEqual(got, exp) {
if !slices.Equal(got, exp) {
t.Errorf("got %d, expected %d", got, exp)
}
}