summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-03-26 08:39:07 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2019-03-29 11:04:20 +0100
commit520b3e63ea2518bd2b356fe2f38be99b2ab75fdb (patch)
treeae7268712bf61b96522975f4b4f7e6a165aeb8e3 /test
parentf9da55cca2eda56ad2e35f654272c257d378d907 (diff)
downloadandroid-node-v8-520b3e63ea2518bd2b356fe2f38be99b2ab75fdb.tar.gz
android-node-v8-520b3e63ea2518bd2b356fe2f38be99b2ab75fdb.tar.bz2
android-node-v8-520b3e63ea2518bd2b356fe2f38be99b2ab75fdb.zip
util: fix map entries inspection
This makes sure the arrays returned by Map#entries() are handled as any other array instead of just visualizing the entries as array. Therefore options should have an impact on the arrays. PR-URL: https://github.com/nodejs/node/pull/26918 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-util-inspect.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js
index d8739de790..85285f4b4f 100644
--- a/test/parallel/test-util-inspect.js
+++ b/test/parallel/test-util-inspect.js
@@ -1017,7 +1017,10 @@ if (typeof Symbol !== 'undefined') {
// Test Set iterators.
{
- const aSet = new Set([1, 3]);
+ const aSet = new Set([1]);
+ assert.strictEqual(util.inspect(aSet.entries(), { compact: false }),
+ '[Set Entries] {\n [\n 1,\n 1\n ]\n}');
+ aSet.add(3);
assert.strictEqual(util.inspect(aSet.keys()), '[Set Iterator] { 1, 3 }');
assert.strictEqual(util.inspect(aSet.values()), '[Set Iterator] { 1, 3 }');
const setEntries = aSet.entries();