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 2c813d8

Browse filesBrowse files
Trottdanielleadams
authored andcommitted
test: improve util-format code coverage
Add test case for calling `util.format()` with a BigInt and a separator. Refs: https://coverage.nodejs.org/coverage-986cf3b986c6c3e1/lib/internal/util/inspect.js.html#L2042 PR-URL: #41572 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
1 parent 1ef28f1 commit 2c813d8
Copy full SHA for 2c813d8

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+7
-0
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-util-format.js
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ assert.strictEqual(
143143
'1180591620717411303424n 12345678901234567890123n'
144144
);
145145

146+
assert.strictEqual(
147+
util.formatWithOptions(
148+
{ numericSeparator: true },
149+
'%i %d', 1180591620717411303424n, 12345678901234567890123n),
150+
'1_180_591_620_717_411_303_424n 12_345_678_901_234_567_890_123n'
151+
);
152+
146153
// Float format specifier
147154
assert.strictEqual(util.format('%f'), '%f');
148155
assert.strictEqual(util.format('%f', 42.0), '42');

0 commit comments

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