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

tisonkun pushed a commit to branch testcase
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git

commit b6107b18117451266669f2a7a61e8a127ee30fc6
Author: tison <[email protected]>
AuthorDate: Mon May 11 18:06:43 2026 +0800

    test: for hll::Array4::shift_to_bigger_cur_min
    
    Signed-off-by: tison <[email protected]>
---
 datasketches/src/hll/array4.rs | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/datasketches/src/hll/array4.rs b/datasketches/src/hll/array4.rs
index f0f6132..fca5af9 100644
--- a/datasketches/src/hll/array4.rs
+++ b/datasketches/src/hll/array4.rs
@@ -503,4 +503,27 @@ mod tests {
             "kxq1 should be small (1/2^40 is tiny)"
         );
     }
+
+    #[test]
+    fn test_shift_cur_min_rebuilds_aux_entry() {
+        let mut arr = Array4::new(4); // 16 buckets
+
+        arr.update(Coupon::pack(0, 15));
+        assert_eq!(arr.get_raw(0), AUX_TOKEN);
+        assert_eq!(arr.aux_map.as_ref().and_then(|aux| aux.get(0)), Some(15));
+
+        for slot in 1..16 {
+            arr.update(Coupon::pack(slot, 1));
+        }
+
+        assert_eq!(arr.cur_min, 1);
+        assert_eq!(arr.num_at_cur_min, 15);
+        assert_eq!(arr.get_raw(0), 14);
+        assert_eq!(arr.get(0), 15);
+        assert!(arr.aux_map.is_none());
+
+        for slot in 1..16 {
+            assert_eq!(arr.get(slot), 1);
+        }
+    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to