@@ -26,10 +26,12 @@ import (
2626 "go.uber.org/mock/gomock/internal/mock_gomock"
2727)
2828
29- type A []string
30- type B struct {
31- Name string
32- }
29+ type (
30+ A []string
31+ B struct {
32+ Name string
33+ }
34+ )
3335
3436func TestMatchers (t * testing.T ) {
3537 type e any
@@ -39,21 +41,27 @@ func TestMatchers(t *testing.T) {
3941 yes , no []e
4042 }{
4143 {"test Any" , gomock .Any (), []e {3 , nil , "foo" }, nil },
42- {"test AnyOf" , gomock .AnyOf (gomock .Nil (), gomock .Len (2 ), 1 , 2 , 3 ),
44+ {
45+ "test AnyOf" , gomock .AnyOf (gomock .Nil (), gomock .Len (2 ), 1 , 2 , 3 ),
4346 []e {nil , "hi" , "to" , 1 , 2 , 3 },
44- []e {"s" , "" , 0 , 4 , 10 }},
47+ []e {"s" , "" , 0 , 4 , 10 },
48+ },
4549 {"test All" , gomock .Eq (4 ), []e {4 }, []e {3 , "blah" , nil , int64 (4 )}},
46- {"test Nil" , gomock .Nil (),
50+ {
51+ "test Nil" , gomock .Nil (),
4752 []e {nil , (error )(nil ), (chan bool )(nil ), (* int )(nil )},
48- []e {"" , 0 , make (chan bool ), errors .New ("err" ), new (int )}},
53+ []e {"" , 0 , make (chan bool ), errors .New ("err" ), new (int )},
54+ },
4955 {"test Not" , gomock .Not (gomock .Eq (4 )), []e {3 , "blah" , nil , int64 (4 )}, []e {4 }},
5056 {"test Regex" , gomock .Regex ("[0-9]{2}:[0-9]{2}" ), []e {"23:02" , "[23:02]: Hello world" , []byte ("23:02" )}, []e {4 , "23-02" , "hello world" , true , []byte ("23-02" )}},
5157 {"test All" , gomock .All (gomock .Any (), gomock .Eq (4 )), []e {4 }, []e {3 , "blah" , nil , int64 (4 )}},
52- {"test Len" , gomock .Len (2 ),
58+ {
59+ "test Len" , gomock .Len (2 ),
5360 []e {[]int {1 , 2 }, "ab" , map [string ]int {"a" : 0 , "b" : 1 }, [2 ]string {"a" , "b" }},
5461 []e {[]int {1 }, "a" , 42 , 42.0 , false , [1 ]string {"a" }},
5562 },
56- {"test assignable types" , gomock .Eq (A {"a" , "b" }),
63+ {
64+ "test assignable types" , gomock .Eq (A {"a" , "b" }),
5765 []e {[]string {"a" , "b" }, A {"a" , "b" }},
5866 []e {[]string {"a" }, A {"b" }},
5967 },
0 commit comments