MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / parser_parses_data_row_messages

Function parser_parses_data_row_messages

src/protocol/tests.rs:598–618  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

596
597#[test]
598fn parser_parses_data_row_messages() -> Result<()> {
599 let buffer_empty = buffers::data_row(&[]);
600 match parse_single(buffer_empty.clone())? {
601 BackendMessage::DataRow(msg) => {
602 assert_eq!(msg.length, buffer_empty.len() - 1);
603 assert!(msg.fields.is_empty());
604 }
605 other => panic!("unexpected message: {:?}", other.name()),
606 }
607
608 let buffer_one = buffers::data_row(&[Some("test")]);
609 match parse_single(buffer_one.clone())? {
610 BackendMessage::DataRow(msg) => {
611 assert_eq!(msg.length, buffer_one.len() - 1);
612 assert_eq!(msg.fields, vec![Some("test".into())]);
613 }
614 other => panic!("unexpected message: {:?}", other.name()),
615 }
616
617 Ok(())
618}
619
620#[test]
621fn parser_parses_notice_and_error_messages() -> Result<()> {

Callers

nothing calls this directly

Calls 2

data_rowFunction · 0.85
parse_singleFunction · 0.85

Tested by

no test coverage detected