tisonkun commented on code in PR #177:
URL: https://github.com/apache/datasketches-rust/pull/177#discussion_r3697463267


##########
datasketches/tests/cpc_test/union.rs:
##########
@@ -179,3 +179,17 @@ fn test_lg_k_too_small() {
 fn test_lg_k_too_large() {
     CpcSketch::new(27);
 }
+
+#[test]
+fn test_union_estimated_size() {
+    let mut union = CpcUnion::new(11);
+    let empty_size = union.estimated_size();
+    assert!(empty_size > 0);
+
+    let mut sketch = CpcSketch::new(11);
+    for i in 0..1000 {
+        sketch.update(i);
+    }
+    union.update(&sketch);
+    assert!(union.estimated_size() > empty_size);
+}

Review Comment:
   Please try to follow 
https://github.com/apache/datasketches-rust/pull/174/changes/05b5ad519327ede5088cacab12b9382d9553f62f
 to assert exact values of estimated_size.



##########
datasketches/tests/cpc_test/union.rs:
##########
@@ -179,3 +179,17 @@ fn test_lg_k_too_small() {
 fn test_lg_k_too_large() {
     CpcSketch::new(27);
 }
+
+#[test]
+fn test_union_estimated_size() {
+    let mut union = CpcUnion::new(11);
+    let empty_size = union.estimated_size();
+    assert!(empty_size > 0);
+
+    let mut sketch = CpcSketch::new(11);
+    for i in 0..1000 {
+        sketch.update(i);
+    }
+    union.update(&sketch);
+    assert!(union.estimated_size() > empty_size);
+}

Review Comment:
   Ditto other similar tests.



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


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

Reply via email to