MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_encode_ready_for_query

Function test_encode_ready_for_query

tests/protocol_test.rs:24–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22
23#[test]
24fn test_encode_ready_for_query() {
25 let mut codec = PostgresCodec::new();
26 let mut buf = BytesMut::new();
27
28 let msg = BackendMessage::ReadyForQuery { status: TransactionStatus::Idle };
29 codec.encode(msg, &mut buf).unwrap();
30
31 assert_eq!(buf[0], b'Z');
32 assert_eq!(&buf[1..5], &5i32.to_be_bytes()); // Fixed length
33 assert_eq!(buf[5], b'I'); // Idle status
34}
35
36#[test]
37fn test_encode_error_response() {

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected