Better diagnostic of tests.

Review URL: http://codereview.chromium.org/669160

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4041 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
antonm@chromium.org 2010-03-05 14:51:24 +00:00
parent df4471c8f3
commit bdee05b3ce

View File

@ -31,13 +31,13 @@
var array = new Array(10);
var spliced = array.splice(1, 1, 'one', 'two');
assertEquals(1, spliced.length);
assertFalse(0 in spliced);
assertFalse(0 in spliced, "0 in spliced");
assertEquals(11, array.length);
assertFalse(0 in array);
assertFalse(0 in array, "0 in array");
assertTrue(1 in array);
assertTrue(2 in array);
assertFalse(3 in array);
assertFalse(3 in array, "3 in array");
}
})();
@ -270,23 +270,23 @@
assertEquals(undefined, array[7]);
// and now check hasOwnProperty
assertFalse(array.hasOwnProperty(0));
assertFalse(array.hasOwnProperty(1));
assertFalse(array.hasOwnProperty(0), "array.hasOwnProperty(0)");
assertFalse(array.hasOwnProperty(1), "array.hasOwnProperty(1)");
assertTrue(array.hasOwnProperty(2));
assertTrue(array.hasOwnProperty(3));
assertTrue(array.hasOwnProperty(4));
assertFalse(array.hasOwnProperty(5));
assertFalse(array.hasOwnProperty(6));
assertFalse(array.hasOwnProperty(7));
assertFalse(array.hasOwnProperty(5), "array.hasOwnProperty(5)");
assertFalse(array.hasOwnProperty(6), "array.hasOwnProperty(6)");
assertFalse(array.hasOwnProperty(7), "array.hasOwnProperty(7)");
assertTrue(array.hasOwnProperty(8));
assertFalse(array.hasOwnProperty(9));
assertFalse(array.hasOwnProperty(9), "array.hasOwnProperty(9)");
// and now check couple of indices above length.
assertFalse(array.hasOwnProperty(10));
assertFalse(array.hasOwnProperty(15));
assertFalse(array.hasOwnProperty(31));
assertFalse(array.hasOwnProperty(63));
assertFalse(array.hasOwnProperty(2 << 32 - 1));
assertFalse(array.hasOwnProperty(10), "array.hasOwnProperty(10)");
assertFalse(array.hasOwnProperty(15), "array.hasOwnProperty(15)");
assertFalse(array.hasOwnProperty(31), "array.hasOwnProperty(31)");
assertFalse(array.hasOwnProperty(63), "array.hasOwnProperty(63)");
assertFalse(array.hasOwnProperty(2 << 32 - 1), "array.hasOwnProperty(2 << 31 - 1)");
}
})();
@ -314,7 +314,7 @@
var a = [7, 8, 9];
a.splice(0, 0, 1, 2, 3, 4, 5, 6);
assertEquals([1, 2, 3, 4, 5, 6, 7, 8, 9], a);
assertFalse(a.hasOwnProperty(10));
assertFalse(a.hasOwnProperty(10), "a.hasOwnProperty(10)");
assertEquals(undefined, a[10]);
}
})();