pgx/zeronull/int2_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 TestInt2Transcode(t *testing.T) {
testutil.TestSuccessfulTranscode(t, "int2", []interface{}{
(zeronull.Int2)(1),
(zeronull.Int2)(0),
})
}
func TestInt2ConvertsGoZeroToNull(t *testing.T) {
testutil.TestGoZeroToNullConversion(t, "int2", (zeronull.Int2)(0))
}
func TestInt2ConvertsNullToGoZero(t *testing.T) {
testutil.TestNullToGoZeroConversion(t, "int2", (zeronull.Int2)(0))
}