Skip to content

Commit a99755f

Browse files
jimivdwMylesBorins
authored andcommitted
test: fix typos in read-buffer tests
The offset-exceeding tests for readFloat contained a double test for readFloatLE instead of one for readFloatLE and one for readFloatBE. This is fixed in this commit. PR-URL: #16834 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 1c192f5 commit a99755f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-buffer-read.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ read(buf, 'readUIntBE', [2, 0], 0xfd);
5959
read(buf, 'readUIntLE', [2, 0], 0x48);
6060

6161
// attempt to overflow buffers, similar to previous bug in array buffers
62-
assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(0xffffffff),
62+
assert.throws(() => Buffer.allocUnsafe(8).readFloatBE(0xffffffff),
6363
RangeError);
6464
assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(0xffffffff),
6565
RangeError);
6666

6767
// ensure negative values can't get past offset
68-
assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(-1), RangeError);
68+
assert.throws(() => Buffer.allocUnsafe(8).readFloatBE(-1), RangeError);
6969
assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(-1), RangeError);
7070

7171
// offset checks

0 commit comments

Comments
 (0)