From ef7c79822f41e48802a457340e6ecea03eb426b3 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 14 Jan 2022 16:25:00 +0000 Subject: [PATCH] test: add coverage for util.inspect() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/41527 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Tobias Nießen --- test/parallel/test-util-inspect.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 029b7cde8a06f8..64852a8bca38b7 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -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' + ); }