| 514 | |
| 515 | #[test] |
| 516 | fn encode_json_null() { |
| 517 | let schema = StrictSchema::new(vec![ |
| 518 | ColumnDef::required("id", ColumnType::Int64).with_primary_key(), |
| 519 | ColumnDef::nullable("data", ColumnType::Json), |
| 520 | ]) |
| 521 | .unwrap(); |
| 522 | let encoder = TupleEncoder::new(&schema); |
| 523 | let tuple = encoder.encode(&[Value::Integer(1), Value::Null]).unwrap(); |
| 524 | // Null bitmap byte (index 9): bit 1 (column 1) should be set → 0b00000010 = 2. |
| 525 | assert_eq!(tuple[9] & 0b10, 0b10); |
| 526 | } |
| 527 | |
| 528 | #[test] |
| 529 | fn encode_bitemporal_roundtrip() { |