Skip to content

Commit 86dabd5

Browse files
SoundharyaKamarajjbgi
authored andcommitted
functionaljava#371: fixed failing property test (functionaljava#373)
1 parent c626f62 commit 86dabd5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

props-core/src/test/java/fj/data/hamt/BitSetProperties.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,19 @@ Property rangeTest() {
156156
int h = list.index(2);
157157
int m = Math.max(l, Math.min(list.index(1), h - 1));
158158
int vh = list.index(3);
159-
159+
160160
BitSet bs1 = longBitSet(x);
161161
BitSet bs2 = bs1.range(l, h);
162+
if(l==h){
163+
return prop(true);
164+
}
162165
boolean b =
163-
bs1.isSet(m) == bs2.isSet(m - l) &&
166+
bs1.isSet(m) == bs2.isSet(m - l) &&
164167
bs2.isSet(vh - l) == false;
165168
return prop(b);
166169
});
167170
}
171+
168172

169173
Property setTest() {
170174
return property(arbNaturalLong, arbBitSetSize, (l, i) -> prop(longBitSet(l).set(i).isSet(i)));

0 commit comments

Comments
 (0)