Skip to content

Commit

Permalink
test: add arrow functions to test-util-inspect
Browse files Browse the repository at this point in the history
Even though arrow functions and ES5 anonymous functions are technically
the same for util.js, it won't hurt to test both.

Backport-PR-URL: nodejs/node#11970
PR-URL: nodejs/node#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>
  • Loading branch information
aqrln authored and andrew749 committed Jul 19, 2017
1 parent 3a35927 commit eabc6f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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(undefined), 'undefined');
assert.strictEqual(util.inspect(null), 'null');
assert.strictEqual(util.inspect(/foo(bar\n)?/gi), '/foo(bar\\n)?/gi');
Expand All @@ -28,6 +29,7 @@ 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: 1, b: 2}), '{ a: 1, b: 2 }');
assert.strictEqual(util.inspect({'a': {}}), '{ a: {} }');
assert.strictEqual(util.inspect({'a': {'b': 2}}), '{ a: { b: 2 } }');
Expand Down

0 comments on commit eabc6f3

Please sign in to comment.