summaryrefslogtreecommitdiff
path: root/test/parallel/test-util-inspect-simd.js
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2016-07-25 09:06:26 +0200
committerAnna Henningsen <anna@addaleax.net>2016-08-02 15:00:59 +0200
commit1b24b37299a15722c11deeb4b663ba39cdc38d09 (patch)
treef3c0fb51f70a2b9ecf8c61f86f7f3bcc0d848224 /test/parallel/test-util-inspect-simd.js
parent80b10b4fe24874d9155980b608b3b49fd5a43ea8 (diff)
downloadnode-new-1b24b37299a15722c11deeb4b663ba39cdc38d09.tar.gz
util: fix formatting of objects with SIMD enabled
When SIMD is enabled, `util.format` couldn’t display objects (with at least 1 key) because the formatter function got overridden. PR-URL: https://github.com/nodejs/node/pull/7864 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Diffstat (limited to 'test/parallel/test-util-inspect-simd.js')
-rw-r--r--test/parallel/test-util-inspect-simd.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/parallel/test-util-inspect-simd.js b/test/parallel/test-util-inspect-simd.js
index 752ea3d0ce..ec4ccc1875 100644
--- a/test/parallel/test-util-inspect-simd.js
+++ b/test/parallel/test-util-inspect-simd.js
@@ -59,3 +59,12 @@ if (typeof SIMD.Uint8x16 === 'function') {
inspect(SIMD.Uint8x16()),
'Uint8x16 [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]');
}
+
+// Tests from test-inspect.js that should not fail with --harmony_simd.
+assert.strictEqual(inspect([]), '[]');
+assert.strictEqual(inspect([0]), '[ 0 ]');
+assert.strictEqual(inspect({}), '{}');
+assert.strictEqual(inspect({foo: 42}), '{ foo: 42 }');
+assert.strictEqual(inspect(null), 'null');
+assert.strictEqual(inspect(true), 'true');
+assert.strictEqual(inspect(false), 'false');