@@ -26,10 +26,12 @@ import (
26
26
"go.uber.org/mock/gomock/internal/mock_gomock"
27
27
)
28
28
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
+ )
33
35
34
36
func TestMatchers (t * testing.T ) {
35
37
type e any
@@ -39,21 +41,27 @@ func TestMatchers(t *testing.T) {
39
41
yes , no []e
40
42
}{
41
43
{"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 ),
43
46
[]e {nil , "hi" , "to" , 1 , 2 , 3 },
44
- []e {"s" , "" , 0 , 4 , 10 }},
47
+ []e {"s" , "" , 0 , 4 , 10 },
48
+ },
45
49
{"test All" , gomock .Eq (4 ), []e {4 }, []e {3 , "blah" , nil , int64 (4 )}},
46
- {"test Nil" , gomock .Nil (),
50
+ {
51
+ "test Nil" , gomock .Nil (),
47
52
[]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
+ },
49
55
{"test Not" , gomock .Not (gomock .Eq (4 )), []e {3 , "blah" , nil , int64 (4 )}, []e {4 }},
50
56
{"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" )}},
51
57
{"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 ),
53
60
[]e {[]int {1 , 2 }, "ab" , map [string ]int {"a" : 0 , "b" : 1 }, [2 ]string {"a" , "b" }},
54
61
[]e {[]int {1 }, "a" , 42 , 42.0 , false , [1 ]string {"a" }},
55
62
},
56
- {"test assignable types" , gomock .Eq (A {"a" , "b" }),
63
+ {
64
+ "test assignable types" , gomock .Eq (A {"a" , "b" }),
57
65
[]e {[]string {"a" , "b" }, A {"a" , "b" }},
58
66
[]e {[]string {"a" }, A {"b" }},
59
67
},
0 commit comments