daescha commented on code in PR #198:
URL: https://github.com/apache/datasketches-go/pull/198#discussion_r4306053725


##########
hll/union_test.go:
##########
@@ -46,6 +46,53 @@ func TestUnions(t *testing.T) {
        checkBasicUnion(t, n1, n2, lgK1, lgK2, lgMaxK, t1, t2, rt)
 }
 
+func TestUnionMixedLgK(t *testing.T) {
+       for _, tc := range []struct{ lgK1, lgK2 int }{{10, 12}, {12, 10}, {12, 
12}, {4, 21}} {
+               for _, lgMaxK := range []int{8, 11, 12, 14} {
+                       for _, n := range []int{100, 3000, 50000} {
+                               for t1 := 0; t1 < 3; t1++ {
+                                       for t2 := 0; t2 < 3; t2++ {
+                                               name := 
fmt.Sprintf("lgK%d_%d/max%d/n%d/t%d_%d", tc.lgK1, tc.lgK2, lgMaxK, n, t1, t2)
+                                               t.Run(name, func(t *testing.T) {
+                                                       
checkUnionMatchesControl(t, n, tc.lgK1, tc.lgK2, lgMaxK, TgtHllType(t1), 
TgtHllType(t2))
+                                               })
+                                       }
+                               }
+                       }
+               }
+       }
+}
+
+// checkUnionMatchesControl compares registers of a union against the same 
values built at the smallest lgK.
+func checkUnionMatchesControl(t *testing.T, n, lgK1, lgK2, lgMaxK int, type1, 
type2 TgtHllType) {

Review Comment:
   done



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