(message: &BackendMessage, expected: &[Option<&str>])
| 331 | } |
| 332 | |
| 333 | fn 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] |
| 353 | fn parser_parses_authentication_messages() -> Result<()> { |
no test coverage detected