@@ -35,12 +35,12 @@ func TestRemember(t *testing.T) {
35
35
36
36
user .Remember (mockIndex , []string {"a" , "b" }, []interface {}{1 , 2 })
37
37
// Check the ConcreteRet calls.
38
- if c := mockIndex .ConcreteRet (); c != boolc {
39
- t .Errorf ("ConcreteRet: got %v, want %v" , c , boolc )
40
- }
41
38
if c := mockIndex .ConcreteRet (); c != nil {
42
39
t .Errorf ("ConcreteRet: got %v, want nil" , c )
43
40
}
41
+ if c := mockIndex .ConcreteRet (); c != boolc {
42
+ t .Errorf ("ConcreteRet: got %v, want %v" , c , boolc )
43
+ }
44
44
45
45
// Try one with an action.
46
46
calledString := ""
@@ -68,22 +68,22 @@ func TestVariadicFunction(t *testing.T) {
68
68
defer ctrl .Finish ()
69
69
70
70
mockIndex := mock_user .NewMockIndex (ctrl )
71
- mockIndex .EXPECT ().Ellip ("%d" , 5 , 6 , 7 , 8 ).Do (func (format string , nums ... int ) {
71
+ mockIndex .EXPECT ().Ellip ("%d" ).Do (func (format string , nums ... int ) {
72
72
sum := 0
73
73
for _ , value := range nums {
74
74
sum += value
75
75
}
76
- if sum != 26 {
77
- t .Errorf ("Expected 7 , got %d" , sum )
76
+ if sum != 0 {
77
+ t .Errorf ("Expected 0 , got %d" , sum )
78
78
}
79
79
})
80
80
mockIndex .EXPECT ().Ellip ("%d" , gomock .Any ()).Do (func (format string , nums ... int ) {
81
81
sum := 0
82
82
for _ , value := range nums {
83
83
sum += value
84
84
}
85
- if sum != 10 {
86
- t .Errorf ("Expected 7 , got %d" , sum )
85
+ if sum != 0 {
86
+ t .Errorf ("Expected 0 , got %d" , sum )
87
87
}
88
88
})
89
89
mockIndex .EXPECT ().Ellip ("%d" , gomock .Any ()).Do (func (format string , nums ... int ) {
@@ -100,22 +100,22 @@ func TestVariadicFunction(t *testing.T) {
100
100
for _ , value := range nums {
101
101
sum += value
102
102
}
103
- if sum != 0 {
104
- t .Errorf ("Expected 0 , got %d" , sum )
103
+ if sum != 10 {
104
+ t .Errorf ("Expected 7 , got %d" , sum )
105
105
}
106
106
})
107
- mockIndex .EXPECT ().Ellip ("%d" ).Do (func (format string , nums ... int ) {
107
+ mockIndex .EXPECT ().Ellip ("%d" , 5 , 6 , 7 , 8 ).Do (func (format string , nums ... int ) {
108
108
sum := 0
109
109
for _ , value := range nums {
110
110
sum += value
111
111
}
112
- if sum != 0 {
113
- t .Errorf ("Expected 0 , got %d" , sum )
112
+ if sum != 26 {
113
+ t .Errorf ("Expected 7 , got %d" , sum )
114
114
}
115
115
})
116
116
117
- mockIndex .Ellip ("%d" , 1 , 2 , 3 , 4 ) // Match second matcher.
118
- mockIndex .Ellip ("%d" , 5 , 6 , 7 , 8 ) // Match first matcher.
117
+ mockIndex .Ellip ("%d" , 1 , 2 , 3 , 4 ) // Match second to last matcher.
118
+ mockIndex .Ellip ("%d" , 5 , 6 , 7 , 8 ) // Match last matcher.
119
119
mockIndex .Ellip ("%d" , 0 )
120
120
mockIndex .Ellip ("%d" )
121
121
mockIndex .Ellip ("%d" )
0 commit comments