martin-g commented on code in PR #1945:
URL: https://github.com/apache/avro/pull/1945#discussion_r1015845801
##########
lang/rust/avro_derive/tests/derive.rs:
##########
@@ -1545,4 +1545,21 @@ mod test_derive {
c: 987.654,
});
}
+
+
+ #[test]
+ fn test_raw_identifier_field_name() {
Review Comment:
```suggestion
fn test_avro_3663_raw_identifier_field_name() {
```
##########
lang/rust/avro_derive/tests/derive.rs:
##########
@@ -1545,4 +1545,21 @@ mod test_derive {
c: 987.654,
});
}
+
+
+ #[test]
+ fn test_raw_identifier_field_name() {
+ #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+ struct TestRawIdent {
+ r#type: bool
+ }
+
+ let derived_schema = TestRawIdent::get_schema();
+ if let Schema::Record { fields, .. } = derived_schema {
+ let field = fields.get(0).expect("TestRawIdent must contain a
field");
+ assert_eq!(field.name, "type");
+ } else {
+ panic!("Unexpected schema type")
Review Comment:
```suggestion
panic!("Unexpected schema type for {:?}", derived_schema)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]