aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql/sql_test.go
diff options
context:
space:
mode:
authorAriel Mashraki <ariel@mashraki.co.il>2021-04-20 16:15:29 +0300
committerEmmanuel Odeke <emmanuel@orijtech.com>2021-05-04 17:31:29 +0000
commit10d625d5b41f17c118da18a592c683e60fcdcb3b (patch)
treeb9377f8f24c7a99f26746525d3bf6bf618cd4226 /src/database/sql/sql_test.go
parent371ea545c015627ffac2139338ea63acda4c1523 (diff)
downloadgo-10d625d5b41f17c118da18a592c683e60fcdcb3b.tar.xz
database/sql: add NullInt16 and NullByte
Fixes #40082 Change-Id: I01cd4d0e23c0376a6ee6e0b196c9f840cd662325 Reviewed-on: https://go-review.googlesource.com/c/go/+/311572 Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Daniel Theophanes <kardianos@gmail.com> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/database/sql/sql_test.go')
-rw-r--r--src/database/sql/sql_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/database/sql/sql_test.go b/src/database/sql/sql_test.go
index 94af39c207..80f63e877d 100644
--- a/src/database/sql/sql_test.go
+++ b/src/database/sql/sql_test.go
@@ -1819,6 +1819,30 @@ func TestNullInt32Param(t *testing.T) {
nullTestRun(t, spec)
}
+func TestNullInt16Param(t *testing.T) {
+ spec := nullTestSpec{"nullint16", "int16", [6]nullTestRow{
+ {NullInt16{31, true}, 1, NullInt16{31, true}},
+ {NullInt16{-22, false}, 1, NullInt16{0, false}},
+ {22, 1, NullInt16{22, true}},
+ {NullInt16{33, true}, 1, NullInt16{33, true}},
+ {NullInt16{222, false}, 1, NullInt16{0, false}},
+ {0, NullInt16{31, false}, nil},
+ }}
+ nullTestRun(t, spec)
+}
+
+func TestNullByteParam(t *testing.T) {
+ spec := nullTestSpec{"nullbyte", "byte", [6]nullTestRow{
+ {NullByte{31, true}, 1, NullByte{31, true}},
+ {NullByte{0, false}, 1, NullByte{0, false}},
+ {22, 1, NullByte{22, true}},
+ {NullByte{33, true}, 1, NullByte{33, true}},
+ {NullByte{222, false}, 1, NullByte{0, false}},
+ {0, NullByte{31, false}, nil},
+ }}
+ nullTestRun(t, spec)
+}
+
func TestNullFloat64Param(t *testing.T) {
spec := nullTestSpec{"nullfloat64", "float64", [6]nullTestRow{
{NullFloat64{31.2, true}, 1, NullFloat64{31.2, true}},