pgx/zeronull/int4_test.go
Jack Christensen c16a4f7d6a Revert "Temporarily delete tests and pgxtype to break recursive dependency with pgx"
This reverts commit 32e20a603178b49fb189d1be971d0fb6960cabb2.
2021-07-24 10:40:30 -05:00

24 lines
510 B
Go

package zeronull_test
import (
"testing"
"github.com/jackc/pgtype/testutil"
"github.com/jackc/pgtype/zeronull"
)
func TestInt4Transcode(t *testing.T) {
testutil.TestSuccessfulTranscode(t, "int4", []interface{}{
(zeronull.Int4)(1),
(zeronull.Int4)(0),
})
}
func TestInt4ConvertsGoZeroToNull(t *testing.T) {
testutil.TestGoZeroToNullConversion(t, "int4", (zeronull.Int4)(0))
}
func TestInt4ConvertsNullToGoZero(t *testing.T) {
testutil.TestNullToGoZeroConversion(t, "int4", (zeronull.Int4)(0))
}