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


##########
avro/tests/serde_human_readable_true.rs:
##########
@@ -59,3 +60,77 @@ fn avro_rs_53_uuid_with_string_true() -> TestResult {
 
     Ok(())
 }
+
+#[test]
+fn avro_rs_440_uuid_string() -> TestResult {
+    #[derive(apache_avro_derive::AvroSchema, Serialize, Deserialize)]
+    #[serde(transparent)]
+    struct CustomUuid {
+        #[avro(with = || Schema::Uuid(UuidSchema::String))]
+        inner: Uuid,
+    }
+    let uuid = CustomUuid {
+        inner: Uuid::parse_str("550e8400-e29b-41d4-a716-446655440000")?,
+    };
+    let mut buffer = Vec::new();
+
+    assert!(apache_avro::util::set_serde_human_readable(true));
+    let mut writer = SpecificSingleObjectWriter::with_capacity(64)?;
+    writer.write(uuid, &mut buffer)?;
+
+    assert_eq!(
+        String::from_utf8_lossy(&buffer),
+        "�\u{1}'G�8�[\u{4}�H550e8400-e29b-41d4-a716-446655440000"

Review Comment:
   The annoying thing about `assert!(.contains())` is that you don't see whats 
wrong if the test does fail



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