()
| 501 | |
| 502 | #[test] |
| 503 | fn roundtrip_all_fields() { |
| 504 | let schema = crm_schema(); |
| 505 | let encoder = TupleEncoder::new(&schema); |
| 506 | let decoder = TupleDecoder::new(&schema); |
| 507 | |
| 508 | let values = vec![ |
| 509 | Value::Integer(42), |
| 510 | Value::String("Alice".into()), |
| 511 | Value::String("alice@example.com".into()), |
| 512 | Value::Decimal(rust_decimal::Decimal::new(5000, 2)), |
| 513 | Value::Bool(true), |
| 514 | ]; |
| 515 | |
| 516 | let tuple = encoder.encode(&values).unwrap(); |
| 517 | let decoded = decoder.extract_all(&tuple).unwrap(); |
| 518 | |
| 519 | assert_eq!(decoded[0], Value::Integer(42)); |
| 520 | assert_eq!(decoded[1], Value::String("Alice".into())); |
| 521 | assert_eq!(decoded[2], Value::String("alice@example.com".into())); |
| 522 | assert_eq!( |
| 523 | decoded[3], |
| 524 | Value::Decimal(rust_decimal::Decimal::new(5000, 2)) |
| 525 | ); |
| 526 | assert_eq!(decoded[4], Value::Bool(true)); |
| 527 | } |
| 528 | |
| 529 | #[test] |
| 530 | fn roundtrip_with_nulls() { |
nothing calls this directly
no test coverage detected