Skip to content

Commit 14d99d5

Browse files
committed
Add missing test case
1 parent ef6412b commit 14d99d5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libs/exponential-histogram/src/test/java/org/elasticsearch/exponentialhistogram/ZeroBucketTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public void testHashCodeEquality() {
7575
assertEqualsContract(ZeroBucket.create(123.56, 123), ZeroBucket.create(123.56, 123));
7676
assertThat(ZeroBucket.create(123.56, 123), not(equalTo(ZeroBucket.create(123.57, 123))));
7777
assertThat(ZeroBucket.create(123.56, 123), not(equalTo(ZeroBucket.create(123.56, 12))));
78+
79+
// the exponentially scaled numbers (index=2, scale=0) and (index=1, scale=-1) both represent 4.0
80+
// therefore the zero buckets should be equal
81+
assertEqualsContract(ZeroBucket.create(2, 0, 123), ZeroBucket.create(1, -1, 123));
82+
assertEqualsContract(ZeroBucket.create(4, 1, 123), ZeroBucket.create(1, -1, 123));
7883
}
7984

8085
void assertEqualsContract(ZeroBucket a, ZeroBucket b) {

0 commit comments

Comments
 (0)