Skip to content

Commit

Permalink
clarify enforceUtf8 argument
Browse files Browse the repository at this point in the history
Co-authored-by: Luke Sandberg <lukesandberg@users.noreply.github.com>
  • Loading branch information
dibenede and lukesandberg authored Jun 17, 2024
1 parent ab150fa commit a90ce67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions binary/decoder_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,11 @@ describe('binaryDecoderTest', () => {

const decoder = jspb.BinaryDecoder.alloc(encoder.end());

expect(decoder.readString(ascii.length, true)).toEqual(ascii);
expect(utf8_two_bytes).toEqual(decoder.readString(2, true));
expect(decoder.readString(ascii.length, /* enforceUtf8= */ true)).toEqual(ascii);
expect(utf8_two_bytes).toEqual(decoder.readString(2, /* enforceUtf8= */ true));
expect(utf8_three_bytes)
.toEqual(decoder.readString(3, true));
expect(utf8_four_bytes).toEqual(decoder.readString(4, true));
.toEqual(decoder.readString(3, /* enforceUtf8= */ true));
expect(utf8_four_bytes).toEqual(decoder.readString(4, /* enforceUtf8= */ true));
});

/**
Expand Down

0 comments on commit a90ce67

Please sign in to comment.