We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a79960 commit ccd9b7fCopy full SHA for ccd9b7f
src/main/go/g0001_0100/s0049_group_anagrams/solution_test.go
@@ -1,7 +1,7 @@
1
package s0049_group_anagrams
2
3
import (
4
- "reflect"
+ "github.com/stretchr/testify/assert"
5
"sort"
6
"testing"
7
)
@@ -15,23 +15,17 @@ func TestGroupAnagrams(t *testing.T) {
15
for i := range actual {
16
sort.Strings(actual[i])
17
}
18
- if !reflect.DeepEqual(actual, expected) {
19
- t.Errorf("Expected: %v, but got: %v", expected, actual)
20
- }
+ assert.Equal(t, expected, actual)
21
22
23
func TestGroupAnagrams2(t *testing.T) {
24
expected := [][]string{{""}}
25
actual := groupAnagrams([]string{""})
26
27
28
29
30
31
func TestGroupAnagrams3(t *testing.T) {
32
expected := [][]string{{"a"}}
33
actual := groupAnagrams([]string{"a"})
34
35
36
37
0 commit comments