Skip to content

Commit

Permalink
fix testMaybeConvertToBytesRefStringCorrectSize (#116386)
Browse files Browse the repository at this point in the history
  • Loading branch information
piergm authored Nov 7, 2024
1 parent a3eba57 commit bf3fcb7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ public void testMaybeConvertToBytesRefStringCorrectSize() {
int correctSize = 0;
for (int i = 0; i < capacity; i++) {
if (i < capacity / 3) {
termBuilder.append((char) randomIntBetween(0, 128));
termBuilder.append((char) randomIntBetween(0, 127));
++correctSize; // use only one byte for char < 128
} else if (i < 2 * capacity / 3) {
termBuilder.append((char) randomIntBetween(128, 2048));
termBuilder.append((char) randomIntBetween(128, 2047));
correctSize += 2; // use two bytes for char < 2048
} else {
termBuilder.append((char) randomIntBetween(2048, 4092));
Expand Down

0 comments on commit bf3fcb7

Please sign in to comment.