| 448 | |
| 449 | #[test] |
| 450 | fn encode_int_to_float_coercion() { |
| 451 | let schema = |
| 452 | StrictSchema::new(vec![ColumnDef::required("val", ColumnType::Float64)]).unwrap(); |
| 453 | let encoder = TupleEncoder::new(&schema); |
| 454 | |
| 455 | // Int64 → Float64 coercion should work. |
| 456 | let tuple = encoder.encode(&[Value::Integer(42)]).unwrap(); |
| 457 | // Header: magic(4)+format_version(1)+schema_version(4)+bitmap(1) = 10. Fixed: 8 bytes Float64. |
| 458 | let f = f64::from_le_bytes(tuple[10..18].try_into().unwrap()); |
| 459 | assert_eq!(f, 42.0); |
| 460 | } |
| 461 | |
| 462 | #[test] |
| 463 | fn encode_timestamp() { |