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

Function roundtrip_with_nulls

nodedb-strict/src/decode.rs:530–551  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

528
529 #[test]
530 fn roundtrip_with_nulls() {
531 let schema = crm_schema();
532 let encoder = TupleEncoder::new(&schema);
533 let decoder = TupleDecoder::new(&schema);
534
535 let values = vec![
536 Value::Integer(1),
537 Value::String("Bob".into()),
538 Value::Null,
539 Value::Decimal(rust_decimal::Decimal::ZERO),
540 Value::Null,
541 ];
542
543 let tuple = encoder.encode(&values).unwrap();
544 let decoded = decoder.extract_all(&tuple).unwrap();
545
546 assert_eq!(decoded[0], Value::Integer(1));
547 assert_eq!(decoded[1], Value::String("Bob".into()));
548 assert_eq!(decoded[2], Value::Null);
549 assert_eq!(decoded[3], Value::Decimal(rust_decimal::Decimal::ZERO));
550 assert_eq!(decoded[4], Value::Null);
551 }
552
553 #[test]
554 fn o1_extraction_single_field() {

Callers

nothing calls this directly

Calls 3

extract_allMethod · 0.80
crm_schemaFunction · 0.70
encodeMethod · 0.45

Tested by

no test coverage detected