Skip to content

Commit 82b5e26

Browse files
committed
♻️ (sum_test): refactor testsumall with reflect.DeepEqual
1 parent d1098ed commit 82b5e26

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arrays-and-slices/sum_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package arrays_and_slices
22

3-
import "testing"
3+
import (
4+
"reflect"
5+
"testing"
6+
)
47

58
func TestSum(t *testing.T) {
69
t.Run("collection of 5 numbers", func(t *testing.T) {
@@ -31,7 +34,7 @@ func TestSumAll(t *testing.T) {
3134
got := SumAll([]int{1, 2}, []int{0, 9})
3235
want := []int{3, 9}
3336

34-
if got != want {
37+
if !reflect.DeepEqual(got, want) {
3538
t.Errorf("got %v want %v", got, want)
3639
}
3740
}

0 commit comments

Comments
 (0)