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

Function test_binary_long_encoding

avro/tests/io.rs:260–269  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

258 for (number, hex_encoding) in binary_encodings().iter() {
259 let encoded = GenericDatumWriter::builder(&Schema::Long)
260 .build()?
261 .write_value_to_vec(Value::Long(*number))?;
262 assert_eq!(&encoded, hex_encoding);
263 }
264
265 Ok(())
266}
267
268#[test]
269fn test_schema_promotion() -> TestResult {
270 // Each schema is present in order of promotion (int -> long, long -> float, float -> double)
271 // Each value represents the expected decoded value when promoting a value previously encoded with a promotable schema
272 let promotable_schemas = [r#""int""#, r#""long""#, r#""float""#, r#""double""#];

Callers

nothing calls this directly

Calls 3

binary_encodingsFunction · 0.85
write_value_to_vecMethod · 0.80
buildMethod · 0.80

Tested by

no test coverage detected