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: increase inspect coverage · nodejs/node@db44b92

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-util-inspect.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-util-inspect.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,17 @@ assert(!/Object/.test(
210210
'ArrayBuffer { (detached), byteLength: 0 }');
211211
}
212212

213+
// Truncate output for ArrayBuffers using plural or singular bytes
214+
{
215+
const ab = new ArrayBuffer(3);
216+
assert.strictEqual(util.inspect(ab, { showHidden: true, maxArrayLength: 2 }),
217+
'ArrayBuffer { [Uint8Contents]' +
218+
': <00 00 ... 1 more byte>, byteLength: 3 }');
219+
assert.strictEqual(util.inspect(ab, { showHidden: true, maxArrayLength: 1 }),
220+
'ArrayBuffer { [Uint8Contents]' +
221+
': <00 ... 2 more bytes>, byteLength: 3 }');
222+
}
223+
213224
// Now do the same checks but from a different context.
214225
{
215226
const showHidden = false;
@@ -2915,6 +2926,12 @@ assert.strictEqual(
29152926
assert.strictEqual(inspect(undetectable), '{}');
29162927
}
29172928

2929+
// Truncate output for Primitives with 1 character left
2930+
{
2931+
assert.strictEqual(util.inspect('bl', { maxStringLength: 1 }),
2932+
"'b'... 1 more character");
2933+
}
2934+
29182935
{
29192936
const x = 'a'.repeat(1e6);
29202937
assert.strictEqual(

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.