MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / encode_json_null

Function encode_json_null

nodedb-strict/src/encode.rs:516–526  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected