MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / test_null_union

Function test_null_union

src/avro/src/reader.rs:1027–1040  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1025
1026 #[mz_ore::test]
1027 fn test_null_union() {
1028 let schema: Schema = UNION_SCHEMA.parse().unwrap();
1029 let mut encoded: &'static [u8] = &[2, 0];
1030
1031 assert_eq!(
1032 from_avro_datum(&schema, &mut encoded).unwrap(),
1033 Value::Union {
1034 index: 1,
1035 inner: Box::new(Value::Long(0)),
1036 n_variants: 2,
1037 null_variant: Some(0)
1038 }
1039 );
1040 }
1041
1042 #[mz_ore::test]
1043 #[cfg_attr(miri, ignore)] // unsupported operation: inline assembly is not supported

Callers

nothing calls this directly

Calls 2

unwrapMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected