@@ -64,64 +64,6 @@ func TestQueryExpectationArgComparison(t *testing.T) {
6464 }
6565}
6666
67- func TestQueryExpectationNamedArgComparison (t * testing.T ) {
68- e := & queryBasedExpectation {}
69- against := []namedValue {{Value : int64 (5 ), Name : "id" }}
70- if err := e .argsMatches (against ); err != nil {
71- t .Errorf ("arguments should match, since the no expectation was set, but got err: %s" , err )
72- }
73-
74- e .args = []driver.Value {
75- namedValue {Name : "id" , Value : int64 (5 )},
76- namedValue {Name : "s" , Value : "str" },
77- }
78-
79- if err := e .argsMatches (against ); err == nil {
80- t .Error ("arguments should not match, since the size is not the same" )
81- }
82-
83- against = []namedValue {
84- {Value : int64 (5 ), Name : "id" },
85- {Value : "str" , Name : "s" },
86- }
87-
88- if err := e .argsMatches (against ); err != nil {
89- t .Errorf ("arguments should have matched, but it did not: %v" , err )
90- }
91-
92- against = []namedValue {
93- {Value : int64 (5 ), Name : "id" },
94- {Value : "str" , Name : "username" },
95- }
96-
97- if err := e .argsMatches (against ); err == nil {
98- t .Error ("arguments matched, but it should have not due to Name" )
99- }
100-
101- e .args = []driver.Value {
102- namedValue {Ordinal : 1 , Value : int64 (5 )},
103- namedValue {Ordinal : 2 , Value : "str" },
104- }
105-
106- against = []namedValue {
107- {Value : int64 (5 ), Ordinal : 0 },
108- {Value : "str" , Ordinal : 1 },
109- }
110-
111- if err := e .argsMatches (against ); err == nil {
112- t .Error ("arguments matched, but it should have not due to wrong Ordinal position" )
113- }
114-
115- against = []namedValue {
116- {Value : int64 (5 ), Ordinal : 1 },
117- {Value : "str" , Ordinal : 2 },
118- }
119-
120- if err := e .argsMatches (against ); err != nil {
121- t .Errorf ("arguments should have matched, but it did not: %v" , err )
122- }
123- }
124-
12567func TestQueryExpectationArgComparisonBool (t * testing.T ) {
12668 var e * queryBasedExpectation
12769
0 commit comments