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

mgrigorov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new 1c12ae6  fix: `test_overflow` doesn't test for overflow (#357)
1c12ae6 is described below

commit 1c12ae68df9cd7b39815228847d4ce0e724bd871
Author: Kriskras99 <[email protected]>
AuthorDate: Mon Dec 8 07:54:55 2025 +0100

    fix: `test_overflow` doesn't test for overflow (#357)
    
    The test still "worked" because an error was still returned, but the
    error was the `ReadVariableIntegerBytes`.
---
 avro/src/util.rs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/avro/src/util.rs b/avro/src/util.rs
index ba319d3..748e923 100644
--- a/avro/src/util.rs
+++ b/avro/src/util.rs
@@ -296,8 +296,13 @@ mod tests {
 
     #[test]
     fn test_overflow() {
-        let causes_left_shift_overflow: &[u8] = &[0xe1, 0xe1, 0xe1, 0xe1, 
0xe1];
-        assert!(decode_variable(&mut &*causes_left_shift_overflow).is_err());
+        let causes_left_shift_overflow: &[u8] = &[0xe1; 10];
+        assert!(matches!(
+            decode_variable(&mut &*causes_left_shift_overflow)
+                .unwrap_err()
+                .details(),
+            Details::IntegerOverflow
+        ));
     }
 
     #[test]

Reply via email to