Browse Source

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 <info@bnoordhuis.nl>
v6.x
Ali Ijaz Sheikh 9 years ago
parent
commit
cda8bfc3c8
  1. 2
      test/parallel/test-child-process-fork-exec-argv.js
  2. 4
      test/parallel/test-console.js
  3. 2
      test/parallel/test-process-exec-argv.js
  4. 6
      test/parallel/test-repl.js
  5. 2
      test/parallel/test-util-inspect-proxy.js
  6. 4
      test/parallel/test-util-inspect.js
  7. 2
      test/parallel/test-util-log.js

2
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));

4
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()));

2
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 = '';

6
test/parallel/test-repl.js

@ -177,7 +177,7 @@ function error_test() {
{ client: client_unix, send: '(function() { "use strict"; eval = 17; })()',
expect: /\bSyntaxError: Unexpected eval or arguments in strict mode/ },
{ client: client_unix, send: '(function() { "use strict"; if (true) function f() { } })()',
expect: /\bSyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function/ },
expect: /\bSyntaxError: 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: /\bSyntaxError: Unexpected token ILLEGAL/ },
expect: /\bSyntaxError: 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: /\bSyntaxError: Unexpected token ILLEGAL/ },
expect: /\bSyntaxError: Invalid or unexpected token/ },
// Mitigate https://github.com/nodejs/node/issues/548
{ client: client_unix, send: 'function name(){ return "node"; };name()',
expect: "'node'\n" + prompt_unix },

2
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);

4
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 } }');
@ -225,7 +225,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;

2
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 ]'}

Loading…
Cancel
Save