...

Source file src/github.com/jackc/pgtype/zeronull/int2_test.go

Documentation: github.com/jackc/pgtype/zeronull

     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 TestInt2Transcode(t *testing.T) {
    11  	testutil.TestSuccessfulTranscode(t, "int2", []interface{}{
    12  		(zeronull.Int2)(1),
    13  		(zeronull.Int2)(0),
    14  	})
    15  }
    16  
    17  func TestInt2ConvertsGoZeroToNull(t *testing.T) {
    18  	testutil.TestGoZeroToNullConversion(t, "int2", (zeronull.Int2)(0))
    19  }
    20  
    21  func TestInt2ConvertsNullToGoZero(t *testing.T) {
    22  	testutil.TestNullToGoZeroConversion(t, "int2", (zeronull.Int2)(0))
    23  }
    24  

View as plain text