mirror of
https://github.com/DATA-DOG/go-sqlmock.git
synced 2025-03-17 20:48:01 +02:00
Update query.go
This commit is contained in:
parent
108200d928
commit
30283daf08
4
query.go
4
query.go
@ -43,6 +43,10 @@ func (f QueryMatcherFunc) Match(expectedSQL, actualSQL string) error {
|
||||
// used by sqlmock. It parses expectedSQL to a regular
|
||||
// expression and attempts to match actualSQL.
|
||||
var QueryMatcherRegexp QueryMatcher = QueryMatcherFunc(func(expectedSQL, actualSQL string) error {
|
||||
if actual != "" and expect == "" {
|
||||
return fmt.Errorf("expectedSQL can't be empty")
|
||||
}
|
||||
|
||||
expect := stripQuery(expectedSQL)
|
||||
actual := stripQuery(actualSQL)
|
||||
re, err := regexp.Compile(expect)
|
||||
|
Loading…
x
Reference in New Issue
Block a user