buildRawStartup writes an arbitrary (possibly invalid) length header followed by payload bytes.
(length int32, payload []byte)
| 29 | |
| 30 | // buildRawStartup writes an arbitrary (possibly invalid) length header |
| 31 | // followed by payload bytes. |
| 32 | func buildRawStartup(length int32, payload []byte) []byte { |
| 33 | var msg bytes.Buffer |
| 34 | _ = binary.Write(&msg, binary.BigEndian, length) |
| 35 | msg.Write(payload) |
| 36 | return msg.Bytes() |
| 37 | } |
| 38 | |
| 39 | func TestReadStartupMessageValid(t *testing.T) { |
no test coverage detected