1
0
mirror of https://github.com/zhashkevych/go-sqlxmock.git synced 2025-06-12 21:47:29 +02:00
Commit Graph

8 Commits

Author SHA1 Message Date
92e5f46c1c tests/NullInt.Scan: remove support for int{,8,16,32}
Those types are not driver.Value, but int was necessary because sqlmock
was not properly using pure driver.Value before. Now that I fixed the
issue in previous commit, we can remove the old hack.
2018-07-12 16:03:36 +02:00
5c0fec018b tests/NullInt.Scan: add FIXME about removing int{,8,16,32} input support
The input of Scan is a driver.Value. Which means the only integer type
on input is a int64. But NullInt.Scan also handles int/int8/int16/int32
while that should not be necessary.

Unfortunately, sqlmock doesn't enforce strict driver.Value in its
implementation and the testsuite (that uses NullInt) relies on this bug.

So, this patch just adds a FIXME until sqlmock internals and testsuite
are fixed (will maybe require breaking the API).
2018-07-12 15:00:04 +02:00
87bbc72050 tests/Null{Int,Time}: do not change the value in case of error
Do not touch the existing value in case of error.
No capital on error message.
2018-07-12 15:00:04 +02:00
9119b1dbff tests/Null{Int,Time}: refactor Scan for less lines of code
Single switch for all cases.
Single return for the success case.
2018-07-12 15:00:04 +02:00
f974ac3c0c tests/NullInt: fix Value() to return a valid driver.Value
Value must return int64, not int.
2018-07-12 15:00:04 +02:00
4f574cddfd tests/NullInt: fix Scan from string/[]byte
Do not change the value if Atoi fails
2018-07-12 15:00:04 +02:00
c1f08b2bb1 tests/NullInt.Scan: fix integer conversion from int{8,16,32,64} 2018-07-12 15:00:04 +02:00
5aa5d01fb9 add test for row builder and NilType based row values 2014-02-14 17:15:06 +02:00