...
1 package zeronull_test
2
3 import (
4 "testing"
5
6 "github.com/jackc/pgtype/testutil"
7 "github.com/jackc/pgtype/zeronull"
8 )
9
10 func TestInt4Transcode(t *testing.T) {
11 testutil.TestSuccessfulTranscode(t, "int4", []interface{}{
12 (zeronull.Int4)(1),
13 (zeronull.Int4)(0),
14 })
15 }
16
17 func TestInt4ConvertsGoZeroToNull(t *testing.T) {
18 testutil.TestGoZeroToNullConversion(t, "int4", (zeronull.Int4)(0))
19 }
20
21 func TestInt4ConvertsNullToGoZero(t *testing.T) {
22 testutil.TestNullToGoZeroConversion(t, "int4", (zeronull.Int4)(0))
23 }
24
View as plain text