File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,12 @@ func (f QueryMatcherFunc) Match(expectedSQL, actualSQL string) error {
4242// QueryMatcherRegexp is the default SQL query matcher
4343// used by sqlmock. It parses expectedSQL to a regular
4444// expression and attempts to match actualSQL.
45- var QueryMatcherRegexp QueryMatcher = QueryMatcherFunc (func (expectedSQL , actualSQL string ) error {
46- if actual != "" and expect == "" {
47- return fmt .Errorf ("expectedSQL can't be empty" )
48- }
49-
45+ var QueryMatcherRegexp QueryMatcher = QueryMatcherFunc (func (expectedSQL , actualSQL string ) error {
5046 expect := stripQuery (expectedSQL )
5147 actual := stripQuery (actualSQL )
48+ if actual != "" && expect == "" {
49+ return fmt .Errorf ("expectedSQL can't be empty" )
50+ }
5251 re , err := regexp .Compile (expect )
5352 if err != nil {
5453 return err
You can’t perform that action at this time.
0 commit comments