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

Function test_encode_authentication

tests/protocol_test.rs:10–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9#[test]
10fn test_encode_authentication() {
11 let mut codec = PostgresCodec::new();
12 let mut buf = BytesMut::new();
13
14 let msg = BackendMessage::Authentication(AuthenticationMessage::Ok);
15 codec.encode(msg, &mut buf).unwrap();
16
17 // Check message format: 'R' + length(4) + auth_type(4)
18 assert_eq!(buf[0], b'R');
19 assert_eq!(&buf[1..5], &8i32.to_be_bytes()); // Length = 8
20 assert_eq!(&buf[5..9], &0i32.to_be_bytes()); // Auth OK = 0
21}
22
23#[test]
24fn test_encode_ready_for_query() {

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected