diff --git a/lib/power-assert-formatter.js b/lib/power-assert-formatter.js index 77190f5..4cdc8b1 100644 --- a/lib/power-assert-formatter.js +++ b/lib/power-assert-formatter.js @@ -210,6 +210,11 @@ value: esNode.value() }; espathToPair[esNode.espath] = pair; + } + }); + Object.keys(espathToPair).forEach(function (espath) { + var pair = espathToPair[espath]; + if (pair.left && pair.right) { pairs.push(pair); } }); diff --git a/test/power_assert_formatter_test.js b/test/power_assert_formatter_test.js index 8e7cb10..461c436 100644 --- a/test/power_assert_formatter_test.js +++ b/test/power_assert_formatter_test.js @@ -1685,6 +1685,20 @@ suite('power-assert-formatter', function () { ]); }); + test('Function object equality', function () { + assertPowerAssertContextFormatting(function () { + eval(weave('assert(function(x,y){ return x + y; } == new Function("x", "y", "return x + y"));')); + }, [ + '# /path/to/some_test.js:1', + '', + 'assert(function (x, y) {return x + y;} == new Function("x", "y", "return x + y"))', + ' | | ', + ' | #function# ', + ' false ', + '' + ]); + }); + });