GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: assert write return values in buffer-bigint64 · nodejs/node@eb3576f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-buffer-bigint64.js
Expand file treeCollapse file tree
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)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.