diff options
author | Alexey Orlenko <eaglexrlnk@gmail.com> | 2017-03-10 05:00:04 +0200 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-03-14 17:52:13 -0700 |
commit | 7acc482432c7b961a52a4a081a87b05f882cf1dd (patch) | |
tree | b2d596639c66058d79dd1a8bb8d2da55f2f5a8b4 /test | |
parent | 1faf136bfdfcf74fefcb507ff25db7b3fcb17ca7 (diff) | |
download | node-new-7acc482432c7b961a52a4a081a87b05f882cf1dd.tar.gz |
test: add arrow functions to test-util-inspect
Even though arrow functions and ES5 anonymous functions are technically
the same for util.js, it won't hurt to test both. The same goes for
async functions.
PR-URL: https://github.com/nodejs/node/pull/11781
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-util-inspect.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index e0a06e97db..c5af77eccf 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -30,7 +30,9 @@ assert.strictEqual(util.inspect(false), 'false'); assert.strictEqual(util.inspect(''), "''"); assert.strictEqual(util.inspect('hello'), "'hello'"); assert.strictEqual(util.inspect(function() {}), '[Function]'); +assert.strictEqual(util.inspect(() => {}), '[Function]'); assert.strictEqual(util.inspect(async function() {}), '[AsyncFunction]'); +assert.strictEqual(util.inspect(async () => {}), '[AsyncFunction]'); assert.strictEqual(util.inspect(function*() {}), '[GeneratorFunction]'); assert.strictEqual(util.inspect(undefined), 'undefined'); assert.strictEqual(util.inspect(null), 'null'); @@ -51,8 +53,11 @@ assert.strictEqual(util.inspect([1, [2, 3]]), '[ 1, [ 2, 3 ] ]'); assert.strictEqual(util.inspect({}), '{}'); assert.strictEqual(util.inspect({a: 1}), '{ a: 1 }'); assert.strictEqual(util.inspect({a: function() {}}), '{ a: [Function: a] }'); +assert.strictEqual(util.inspect({a: () => {}}), '{ a: [Function: a] }'); assert.strictEqual(util.inspect({a: async function() {}}), '{ a: [AsyncFunction: a] }'); +assert.strictEqual(util.inspect({a: async () => {}}), + '{ a: [AsyncFunction: a] }'); assert.strictEqual(util.inspect({a: function*() {}}), '{ a: [GeneratorFunction: a] }'); assert.strictEqual(util.inspect({a: 1, b: 2}), '{ a: 1, b: 2 }'); |