()
| 528 | |
| 529 | #[test] |
| 530 | fn roundtrip_with_nulls() { |
| 531 | let schema = crm_schema(); |
| 532 | let encoder = TupleEncoder::new(&schema); |
| 533 | let decoder = TupleDecoder::new(&schema); |
| 534 | |
| 535 | let values = vec![ |
| 536 | Value::Integer(1), |
| 537 | Value::String("Bob".into()), |
| 538 | Value::Null, |
| 539 | Value::Decimal(rust_decimal::Decimal::ZERO), |
| 540 | Value::Null, |
| 541 | ]; |
| 542 | |
| 543 | let tuple = encoder.encode(&values).unwrap(); |
| 544 | let decoded = decoder.extract_all(&tuple).unwrap(); |
| 545 | |
| 546 | assert_eq!(decoded[0], Value::Integer(1)); |
| 547 | assert_eq!(decoded[1], Value::String("Bob".into())); |
| 548 | assert_eq!(decoded[2], Value::Null); |
| 549 | assert_eq!(decoded[3], Value::Decimal(rust_decimal::Decimal::ZERO)); |
| 550 | assert_eq!(decoded[4], Value::Null); |
| 551 | } |
| 552 | |
| 553 | #[test] |
| 554 | fn o1_extraction_single_field() { |
nothing calls this directly
no test coverage detected