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

Function assert_data_row_fields

src/protocol/tests.rs:333–350  ·  view source on GitHub ↗
(message: &BackendMessage, expected: &[Option<&str>])

Source from the content-addressed store, hash-verified

331}
332
333fn assert_data_row_fields(message: &BackendMessage, expected: &[Option<&str>]) {
334 match message {
335 BackendMessage::DataRow(row) => {
336 assert_eq!(row.fields.len(), expected.len());
337 for (actual, expected_value) in row.fields.iter().zip(expected.iter()) {
338 match (actual, expected_value) {
339 (Some(actual), Some(expected)) => assert_eq!(actual, expected),
340 (None, None) => {}
341 (other_actual, other_expected) => panic!(
342 "mismatched field value: expected {:?}, got {:?}",
343 other_expected, other_actual
344 ),
345 }
346 }
347 }
348 other => panic!("expected dataRow message, got {:?}", other.name()),
349 }
350}
351
352#[test]
353fn parser_parses_authentication_messages() -> Result<()> {

Calls 1

iterMethod · 0.80

Tested by

no test coverage detected