Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
reshke committed Apr 23, 2024
1 parent 4486d1e commit 9d5e782
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion test/xproto/proto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,48 @@ func TestMultiPortal(t *testing.T) {
}

tt := []MessageGroup{
{
Request: []pgproto3.FrontendMessage{
&pgproto3.Parse{
Name: "mp-0-1",
Query: "SELECT 1",
},
&pgproto3.Sync{},

&pgproto3.Bind{
DestinationPortal: "",
PreparedStatement: "mp-0-1",
},
&pgproto3.Sync{},

&pgproto3.Execute{
Portal: "",
},
&pgproto3.Sync{},
},

Response: []pgproto3.BackendMessage{

&pgproto3.ParseComplete{},
&pgproto3.ReadyForQuery{
TxStatus: byte(txstatus.TXIDLE),
},

&pgproto3.BindComplete{},

&pgproto3.ReadyForQuery{
TxStatus: byte(txstatus.TXIDLE),
},

&pgproto3.ErrorResponse{
Severity: "ERROR",
Code: "34000",
},
&pgproto3.ReadyForQuery{
TxStatus: byte(txstatus.TXIDLE),
},
},
},
{
Request: []pgproto3.FrontendMessage{
&pgproto3.Parse{
Expand Down Expand Up @@ -2422,7 +2464,6 @@ func TestMultiPortal(t *testing.T) {
retMsgType.SeverityUnlocalized = ""
retMsgType.File = ""
retMsgType.Message = ""
retMsgType.Code = ""

case *pgproto3.RowDescription:
for i := range retMsgType.Fields {
Expand Down

0 comments on commit 9d5e782

Please sign in to comment.