diff --git a/expectations.go b/expectations.go index c2e3107..65092b6 100644 --- a/expectations.go +++ b/expectations.go @@ -246,7 +246,7 @@ func (e *ExpectedExec) String() string { msg += fmt.Sprintf("\t\t%d - %+v\n", i, arg) } } - if e.result.String() > "" { + if e.result.String() != "" { msg += fmt.Sprintf("\t- returns result: %s\n", e.result) } diff --git a/pgxmock.go b/pgxmock.go index 42bf939..db70c08 100644 --- a/pgxmock.go +++ b/pgxmock.go @@ -434,7 +434,7 @@ func (c *pgxmock) Query(ctx context.Context, sql string, args ...interface{}) (p } if rewrittenSQL, err := queryExp.argsMatches(sql, args); err != nil { return err - } else if rewrittenSQL > "" { + } else if rewrittenSQL != "" { if err := c.queryMatcher.Match(queryExp.expectRewrittenSQL, rewrittenSQL); err != nil { return err } @@ -474,7 +474,7 @@ func (c *pgxmock) Exec(ctx context.Context, query string, args ...interface{}) ( } if rewrittenSQL, err := execExp.argsMatches(query, args); err != nil { return err - } else if rewrittenSQL > "" { + } else if rewrittenSQL != "" { if err := c.queryMatcher.Match(execExp.expectRewrittenSQL, rewrittenSQL); err != nil { //pgx support QueryRewriter for arguments, now we can check if the query was actually rewriten return err