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 eb3576f

Browse filesBrowse files
nektroaduh95
authored andcommitted
test: assert write return values in buffer-bigint64
PR-URL: #57212 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6a2e4c5 commit eb3576f
Copy full SHA for eb3576f

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+6
-1
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-buffer-bigint64.js
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require('../common');
33
const assert = require('assert');
44

5-
const buf = Buffer.allocUnsafe(8);
5+
const buf = Buffer.allocUnsafe(9);
66

77
['LE', 'BE'].forEach(function(endianness) {
88
// Should allow simple BigInts to be written and read
@@ -27,6 +27,11 @@ const buf = Buffer.allocUnsafe(8);
2727
buf[`writeBigUInt64${endianness}`](val, 0);
2828
assert.strictEqual(val, buf[`readBigUInt64${endianness}`](0));
2929

30+
assert.strictEqual(buf[`writeBigUInt64${endianness}`](val, 0), 8);
31+
assert.strictEqual(buf[`writeBigInt64${endianness}`](val, 0), 8);
32+
assert.strictEqual(buf[`writeBigUInt64${endianness}`](val, 1), 9);
33+
assert.strictEqual(buf[`writeBigInt64${endianness}`](val, 1), 9);
34+
3035
// Should throw a RangeError upon INT64_MAX+1 being written
3136
assert.throws(function() {
3237
const val = 0x8000000000000000n;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.