mirror of
https://github.com/DATA-DOG/go-sqlmock.git
synced 2025-05-13 21:56:39 +02:00
Fixing incorrect []byte handling in expectation.
Fixes the incorrect handling of []byte when comparing an argument recieved from Exec or Query and the exepected value. Closes #35
This commit is contained in:
parent
b54b0cd4c8
commit
19a0529399
@ -3,6 +3,7 @@ package sqlmock
|
|||||||
import (
|
import (
|
||||||
"database/sql/driver"
|
"database/sql/driver"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"reflect"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@ -349,7 +350,7 @@ func (e *queryBasedExpectation) argsMatches(args []driver.Value) error {
|
|||||||
return fmt.Errorf("argument %d: non-subset type %T returned from Value", k, darg)
|
return fmt.Errorf("argument %d: non-subset type %T returned from Value", k, darg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if darg != args[k] {
|
if !reflect.DeepEqual(darg, args[k]) {
|
||||||
return fmt.Errorf("argument %d expected [%T - %+v] does not match actual [%T - %+v]", k, darg, darg, args[k], args[k])
|
return fmt.Errorf("argument %d expected [%T - %+v] does not match actual [%T - %+v]", k, darg, darg, args[k], args[k])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user