Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

fix test-sys for hash randomization

broken in 4a899c9
  • Loading branch information
ry committed Jan 6, 2012
1 parent 4a899c9 commit 8bd80f49117d6a772584a8d93dface0fb31ad931
Showing with 21 additions and 9 deletions.
  1. +21 −9 test/simple/test-sys.js
@@ -60,17 +60,29 @@ assert.equal('{ visible: 1 }',
common.inspect(Object.create({},
{visible: {value: 1, enumerable: true}, hidden: {value: 2}}))
);
assert.equal('{ [hidden]: 2, visible: 1 }',
common.inspect(Object.create({},
{visible: {value: 1, enumerable: true}, hidden: {value: 2}}), true)
);

// Due to the hash seed randomization it's not deterministic the order that
// the following ways this hash is displayed.
// See http://codereview.chromium.org/9124004/

var out = common.inspect(Object.create({},
{visible: {value: 1, enumerable: true}, hidden: {value: 2}}), true);
if (out !== '{ [hidden]: 2, visible: 1 }' &&
out !== '{ visible: 1, [hidden]: 2 }') {
assert.ok(false);
}


// Objects without prototype
assert.equal('{ [hidden]: \'secret\', name: \'Tim\' }',
common.inspect(Object.create(null,
{name: {value: 'Tim', enumerable: true},
hidden: {value: 'secret'}}), true)
);
var out = common.inspect(Object.create(null,
{ name: {value: 'Tim', enumerable: true},
hidden: {value: 'secret'}}), true);
if (out !== "{ [hidden]: 'secret', name: 'Tim' }" &&
out !== "{ name: 'Tim', [hidden]: 'secret' }") {
assert(false);
}


assert.equal('{ name: \'Tim\' }',
common.inspect(Object.create(null,
{name: {value: 'Tim', enumerable: true},

0 comments on commit 8bd80f4

Please sign in to comment.
You can’t perform that action at this time.