This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch issue-53-debug-failing-test
in repository https://gitbox.apache.org/repos/asf/avro-rs.git

commit 80a8e0a0f7caa3df4ededf86c0a84c9fb6a2fb7b
Author: Martin Tzvetanov Grigorov <[email protected]>
AuthorDate: Wed Dec 4 10:13:34 2024 +0200

    Issue #53 - Panic to get the stacktrace of an intermittent test failure
    
    Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
---
 avro/src/types.rs | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/avro/src/types.rs b/avro/src/types.rs
index 8b8090d..7313efc 100644
--- a/avro/src/types.rs
+++ b/avro/src/types.rs
@@ -458,6 +458,17 @@ impl Value {
             (&Value::Double(_), &Schema::Double) => None,
             (&Value::Bytes(_), &Schema::Bytes) => None,
             (&Value::Bytes(_), &Schema::Decimal { .. }) => None,
+            (Value::Bytes(bytes), &Schema::Uuid) => {
+                panic!("Debugging");
+                // if bytes.len() == 16 {
+                //     None
+                // } else {
+                //     Some(format!(
+                //         "Uuid must be Bytes with length '16', not '{}'!",
+                //         bytes.len()
+                //     ))
+                // }
+            }
             (&Value::String(_), &Schema::String) => None,
             (&Value::String(_), &Schema::Uuid) => None,
             (&Value::Fixed(n, _), &Schema::Fixed(FixedSchema { size, .. })) => 
{
@@ -491,6 +502,16 @@ impl Value {
             }
             // TODO: check precision against n
             (&Value::Fixed(_n, _), &Schema::Decimal { .. }) => None,
+            // (&Value::Fixed(size, _), &Schema::Uuid) => {
+            //     if size == 16 {
+            //         None
+            //     } else {
+            //         Some(format!(
+            //             "Uuid must be Fixed with size '16', not '{}'!",
+            //             size
+            //         ))
+            //     }
+            // }
             (Value::String(s), Schema::Enum(EnumSchema { symbols, .. })) => {
                 if !symbols.contains(s) {
                     Some(format!("'{s}' is not a member of the possible 
symbols"))

Reply via email to