()
| 839 | |
| 840 | #[test] |
| 841 | fn 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)] |
| 888 | struct Testu8 { |
nothing calls this directly
no test coverage detected