Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b166b6b

Browse filesBrowse 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 60c918a commit b166b6b
Copy full SHA for b166b6b

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-buffer-read.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-buffer-read.js
+2-2Lines changed: 2 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.