You've already forked go-sqlxmock
							
							
				mirror of
				https://github.com/zhashkevych/go-sqlxmock.git
				synced 2025-10-30 23:27:38 +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:
		| @@ -3,6 +3,7 @@ package sqlmock | ||||
| import ( | ||||
| 	"database/sql/driver" | ||||
| 	"fmt" | ||||
| 	"reflect" | ||||
| 	"regexp" | ||||
| 	"strings" | ||||
| 	"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) | ||||
| 		} | ||||
|  | ||||
| 		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]) | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user