Kriskras99 commented on code in PR #401:
URL: https://github.com/apache/avro-rs/pull/401#discussion_r2692179186


##########
avro_derive/tests/derive.rs:
##########
@@ -1827,3 +1827,88 @@ fn avro_rs_247_serde_flatten_support_with_skip() {
         b: 321,
     });
 }
+
+#[test]
+fn avro_rs_401_do_not_match_typename() {
+    #[expect(nonstandard_style, reason = "It needs to be exactly this")]
+    type f32 = f64;
+
+    #[expect(dead_code, reason = "We only check the schema")]
+    #[derive(AvroSchema)]
+    struct Foo {
+        field: f32,
+    }
+
+    let schema = r#"
+    {
+        "type":"record",
+        "name":"Foo",
+        "fields": [
+            {
+                "name":"field",
+                "type":"double"
+            }
+        ]
+    }
+    "#;
+
+    let schema = Schema::parse_str(schema).unwrap();
+    assert_eq!(schema, Foo::get_schema());
+}
+
+#[test]
+fn avro_rs_401_supported_type_variants() {
+    #[expect(dead_code, reason = "We only check the schema")]
+    #[derive(AvroSchema)]
+    struct Foo<'a> {
+        one: f32,
+        two: std::string::String,
+        three: &'static i32,
+        four: &'a str,
+        five: &'a mut f64,
+        six: [u8; 5],
+        seven: [u8],

Review Comment:
   You have to construct it directly on the heap (the parent type becomes an 
unsized type), but I don't know the specifics.
   As we only need to test the schema generated it's not a problem.



-- 
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]

Reply via email to