Skip to content

Commit f947f72

Browse files
TrottBethGriggs
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 <[email protected]> Reviewed-By: Mestery <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
1 parent b43faf0 commit f947f72

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/parallel/test-util-format.js

+7
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)