MCPcopy Create free account
hub / github.com/apache/avro-rs / test_encode_empty_array

Function test_encode_empty_array

avro/src/encode.rs:388–401  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

386 pub(crate) fn success(value: &Value, schema: &Schema) -> String {
387 format!("Value: {value:?}\n should encode with schema:\n{schema:?}")
388 }
389
390 #[test]
391 fn test_encode_empty_array() {
392 let mut buf = Vec::new();
393 let empty: Vec<Value> = Vec::new();
394 encode(
395 &Value::Array(empty.clone()),
396 &Schema::array(Schema::Int).build(),
397 &mut buf,
398 )
399 .expect(&success(
400 &Value::Array(empty),
401 &Schema::array(Schema::Int).build(),
402 ));
403 assert_eq!(vec![0u8], buf);
404 }

Callers

nothing calls this directly

Calls 4

encodeFunction · 0.85
successFunction · 0.85
buildMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected