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

Function test_complex_array

avro_derive/tests/derive.rs:841–885  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

839
840#[test]
841fn test_complex_array() {
842 let schema = r#"
843 {
844 "type":"record",
845 "name":"TestComplexArray",
846 "fields":[
847 {
848 "name":"a",
849 "type": {
850 "type":"array",
851 "items":{
852 "type":"record",
853 "name":"TestBasic",
854 "fields":[
855 {
856 "name":"a",
857 "type":"int"
858 },
859 {
860 "name":"b",
861 "type":"string"
862 }
863 ]
864 }
865 }
866 }
867 ]
868 }
869 "#;
870 let schema = Schema::parse_str(schema).unwrap();
871 assert_eq!(schema, TestComplexArray::<TestBasic>::get_schema());
872 let test = TestComplexArray::<TestBasic> {
873 a: [
874 TestBasic {
875 a: 27,
876 b: "foo".to_owned(),
877 },
878 TestBasic {
879 a: 28,
880 b: "bar".to_owned(),
881 },
882 ],
883 };
884 serde_assert(test);
885}
886
887#[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq, Eq)]
888struct Testu8 {

Callers

nothing calls this directly

Calls 1

serde_assertFunction · 0.70

Tested by

no test coverage detected