Skip to content

Commit

Permalink
test: add coverage for util.inspect()
Browse files Browse the repository at this point in the history
Coverage stats indicate that there is no coverage for util.inspect()
with a negative number and a numeric separator. Add a test case.

Refs: https://coverage.nodejs.org/coverage-df507758e6c35534/lib/internal/util/inspect.js.html#L1463

PR-URL: #41527
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • Loading branch information
Trott authored and BethGriggs committed Jan 24, 2022
1 parent 9226322 commit ef7c798
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -3231,4 +3231,9 @@ assert.strictEqual(
util.inspect(123456789.12345678, { numericSeparator: true }),
'123_456_789.123_456_78'
);

assert.strictEqual(
util.inspect(-123456789.12345678, { numericSeparator: true }),
'-123_456_789.123_456_78'
);
}

0 comments on commit ef7c798

Please sign in to comment.