From 9940766f8a09c2eec06f582cbb0b4883f601be89 Mon Sep 17 00:00:00 2001 From: Ali Ijaz Sheikh Date: Fri, 4 Mar 2016 14:15:42 -0800 Subject: [PATCH] test: fix tests after V8 upgrade * Changes to messages. * V8 enabled proxy support by default. The --harmony_proxies flag is now gone. PR-URL: https://github.com/nodejs/node/pull/6482 Reviewed-By: bnoordhuis - Ben Noordhuis --- test/parallel/test-child-process-fork-exec-argv.js | 2 +- test/parallel/test-console.js | 4 ++-- test/parallel/test-process-exec-argv.js | 2 +- test/parallel/test-repl.js | 6 +++--- test/parallel/test-util-inspect-proxy.js | 2 +- test/parallel/test-util-inspect.js | 4 ++-- test/parallel/test-util-log.js | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/parallel/test-child-process-fork-exec-argv.js b/test/parallel/test-child-process-fork-exec-argv.js index f37eb019f25de5..5ccc17fb3fc7c4 100644 --- a/test/parallel/test-child-process-fork-exec-argv.js +++ b/test/parallel/test-child-process-fork-exec-argv.js @@ -12,7 +12,7 @@ if (process.argv[2] === 'fork') { } else if (process.argv[2] === 'child') { fork(__filename, ['fork']); } else { - var execArgv = ['--harmony_proxies', '--stack-size=256']; + var execArgv = ['--stack-size=256']; var args = [__filename, 'child', 'arg0']; var child = spawn(process.execPath, execArgv.concat(args)); diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index 6db6991108e239..2c8a498a331b55 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -111,8 +111,8 @@ for (const expected of expectedStrings) { assert.equal(expected + '\n', errStrings.shift()); // console.warn (stderr) } -assert.equal("{ foo: 'bar', inspect: [Function] }\n", strings.shift()); -assert.equal("{ foo: 'bar', inspect: [Function] }\n", strings.shift()); +assert.equal("{ foo: 'bar', inspect: [Function: inspect] }\n", strings.shift()); +assert.equal("{ foo: 'bar', inspect: [Function: inspect] }\n", strings.shift()); assert.notEqual(-1, strings.shift().indexOf('foo: [Object]')); assert.equal(-1, strings.shift().indexOf('baz')); assert.ok(/^label: \d+\.\d{3}ms$/.test(strings.shift().trim())); diff --git a/test/parallel/test-process-exec-argv.js b/test/parallel/test-process-exec-argv.js index 178b84c23fcc70..e32971ae81a893 100644 --- a/test/parallel/test-process-exec-argv.js +++ b/test/parallel/test-process-exec-argv.js @@ -6,7 +6,7 @@ var spawn = require('child_process').spawn; if (process.argv[2] === 'child') { process.stdout.write(JSON.stringify(process.execArgv)); } else { - var execArgv = ['--harmony_proxies', '--stack-size=256']; + var execArgv = ['--stack-size=256']; var args = [__filename, 'child', 'arg0']; var child = spawn(process.execPath, execArgv.concat(args)); var out = ''; diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 219ebea4c6783b..f321f43174b135 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -177,7 +177,7 @@ function error_test() { { client: client_unix, send: '(function() { "use strict"; eval = 17; })()', expect: /^SyntaxError: Unexpected eval or arguments in strict mode/ }, { client: client_unix, send: '(function() { "use strict"; if (true) function f() { } })()', - expect: /^SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function/ }, + expect: /^SyntaxError: In strict mode code, functions can only be declared at top level or inside a block./ }, // Named functions can be used: { client: client_unix, send: 'function blah() { return 1; }', expect: prompt_unix }, @@ -228,7 +228,7 @@ function error_test() { expect: 'Invalid REPL keyword\n' + prompt_unix }, // fail when we are not inside a String and a line continuation is used { client: client_unix, send: '[] \\', - expect: /^SyntaxError: Unexpected token ILLEGAL/ }, + expect: /^SyntaxError: Invalid or unexpected token/ }, // do not fail when a String is created with line continuation { client: client_unix, send: '\'the\\\nfourth\\\neye\'', expect: prompt_multiline + prompt_multiline + @@ -327,7 +327,7 @@ function error_test() { // Illegal token is not recoverable outside string literal, RegExp literal, // or block comment. https://github.com/nodejs/node/issues/3611 { client: client_unix, send: 'a = 3.5e', - expect: /^SyntaxError: Unexpected token ILLEGAL/ }, + expect: /^SyntaxError: Invalid or unexpected token/ }, ]); } diff --git a/test/parallel/test-util-inspect-proxy.js b/test/parallel/test-util-inspect-proxy.js index 6311884b85b5f1..744bf235266e86 100644 --- a/test/parallel/test-util-inspect-proxy.js +++ b/test/parallel/test-util-inspect-proxy.js @@ -22,7 +22,7 @@ assert.strictEqual(target, details[0]); assert.strictEqual(handler, details[1]); assert.strictEqual(util.inspect(proxyObj, opts), - 'Proxy [ {}, { get: [Function] } ]'); + 'Proxy [ {}, { get: [Function: get] } ]'); // Using getProxyDetails with non-proxy returns undefined assert.strictEqual(processUtil.getProxyDetails({}), undefined); diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index b0079de6bab9fa..ee009720211c59 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -25,7 +25,7 @@ assert.equal(util.inspect([1, [2, 3]]), '[ 1, [ 2, 3 ] ]'); assert.equal(util.inspect({}), '{}'); assert.equal(util.inspect({a: 1}), '{ a: 1 }'); -assert.equal(util.inspect({a: function() {}}), '{ a: [Function] }'); +assert.equal(util.inspect({a: function() {}}), '{ a: [Function: a] }'); assert.equal(util.inspect({a: 1, b: 2}), '{ a: 1, b: 2 }'); assert.equal(util.inspect({'a': {}}), '{ a: {} }'); assert.equal(util.inspect({'a': {'b': 2}}), '{ a: { b: 2 } }'); @@ -218,7 +218,7 @@ assert.equal(util.inspect(value), '[ 1, 2, 3, growingLength: [Getter] ]'); // Function with properties value = function() {}; value.aprop = 42; -assert.equal(util.inspect(value), '{ [Function] aprop: 42 }'); +assert.equal(util.inspect(value), '{ [Function: value] aprop: 42 }'); // Regular expressions with properties value = /123/ig; diff --git a/test/parallel/test-util-log.js b/test/parallel/test-util-log.js index b9e3d9ce3505e0..91f77d994da847 100644 --- a/test/parallel/test-util-log.js +++ b/test/parallel/test-util-log.js @@ -19,7 +19,7 @@ var tests = [ {input: null, output: 'null'}, {input: false, output: 'false'}, {input: 42, output: '42'}, - {input: function() {}, output: '[Function]'}, + {input: function() {}, output: '[Function: input]'}, {input: parseInt('not a number', 10), output: 'NaN'}, {input: {answer: 42}, output: '{ answer: 42 }'}, {input: [1, 2, 3], output: '[ 1, 2, 3 ]'}