2
0

Removed TextEncoder and BinaryEncoder

Restructured / fixed a lot of tests along the way.
This commit is contained in:
Jack Christensen
2022-01-22 12:07:35 -06:00
parent eb0a4c9626
commit 3a90c6c879
50 changed files with 295 additions and 758 deletions
+2 -11
View File
@@ -17,7 +17,7 @@ func isExpectedEqBits(a interface{}) func(interface{}) bool {
}
func TestBitsCodecBit(t *testing.T) {
testPgxCodec(t, "bit(40)", []PgxTranscodeTestCase{
testutil.RunTranscodeTests(t, "bit(40)", []testutil.TranscodeTestCase{
{
pgtype.Bits{Bytes: []byte{0, 0, 0, 0, 0}, Len: 40, Valid: true},
new(pgtype.Bits),
@@ -34,7 +34,7 @@ func TestBitsCodecBit(t *testing.T) {
}
func TestBitsCodecVarbit(t *testing.T) {
testPgxCodec(t, "varbit", []PgxTranscodeTestCase{
testutil.RunTranscodeTests(t, "varbit", []testutil.TranscodeTestCase{
{
pgtype.Bits{Bytes: []byte{}, Len: 0, Valid: true},
new(pgtype.Bits),
@@ -54,12 +54,3 @@ func TestBitsCodecVarbit(t *testing.T) {
{nil, new(pgtype.Bits), isExpectedEqBits(pgtype.Bits{})},
})
}
func TestBitsNormalize(t *testing.T) {
testutil.TestSuccessfulNormalize(t, []testutil.NormalizeTest{
{
SQL: "select B'111111111'",
Value: &pgtype.Bits{Bytes: []byte{255, 128}, Len: 9, Valid: true},
},
})
}