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 6129376

Browse filesBrowse files
wentouttargos
authored andcommitted
test: add coverage for sparse array maxArrayLength
code and learn task for additional coverage for situation when maxArrayLength option is passed to util.inspect for sparse array and is set to number lower than actual number of entries PR-URL: #27901 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent cc69d5a commit 6129376
Copy full SHA for 6129376

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+4
-0
lines changed
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
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,10 @@ assert.strictEqual(util.inspect(-5e-324), '-5e-324');
520520
util.inspect(a, { maxArrayLength: 4 }),
521521
"[ 'foo', <1 empty item>, 'baz', <97 empty items>, ... 1 more item ]"
522522
);
523+
// test 4 special case
524+
assert.strictEqual(util.inspect(a, {
525+
maxArrayLength: 2
526+
}), "[ 'foo', <1 empty item>, ... 99 more items ]");
523527
}
524528

525529
// Test for Array constructor in different context.

0 commit comments

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