(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestEncodeDecode(t *testing.T) { |
| 12 | srcBytes := []byte{'W', 0x00, 0x00, 0x00, 0x0b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01} |
| 13 | dstResp := pgproto3.CopyBothResponse{} |
| 14 | err := dstResp.Decode(srcBytes[5:]) |
| 15 | assert.NoError(t, err, "No errors on decode") |
| 16 | dstBytes := []byte{} |
| 17 | dstBytes, err = dstResp.Encode(dstBytes) |
| 18 | require.NoError(t, err) |
| 19 | assert.EqualValues(t, srcBytes, dstBytes, "Expecting src & dest bytes to match") |
| 20 | } |