()
| 552 | |
| 553 | #[test] |
| 554 | fn o1_extraction_single_field() { |
| 555 | let schema = crm_schema(); |
| 556 | let decoder = TupleDecoder::new(&schema); |
| 557 | |
| 558 | let tuple = encode_crm_row(&[ |
| 559 | Value::Integer(99), |
| 560 | Value::String("Charlie".into()), |
| 561 | Value::String("charlie@co.com".into()), |
| 562 | Value::Decimal(rust_decimal::Decimal::new(12345, 0)), |
| 563 | Value::Bool(false), |
| 564 | ]); |
| 565 | |
| 566 | // Extract just the balance (column 3) without touching other columns. |
| 567 | let balance = decoder.extract_value(&tuple, 3).unwrap(); |
| 568 | assert_eq!( |
| 569 | balance, |
| 570 | Value::Decimal(rust_decimal::Decimal::new(12345, 0)) |
| 571 | ); |
| 572 | |
| 573 | // Extract just the name (column 1) — variable-length. |
| 574 | let name = decoder.extract_value(&tuple, 1).unwrap(); |
| 575 | assert_eq!(name, Value::String("Charlie".into())); |
| 576 | } |
| 577 | |
| 578 | #[test] |
| 579 | fn extract_by_name() { |
nothing calls this directly
no test coverage detected