blob: ee001c5e3555d827d5c73ea95911a0d42acfc7fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
function f() {
var arr = [];
var iters = 1500;
for (var i = 0; i < iters; i++) {
arr.push(i);
if (i % 2 === 0)
assertEq(arr.shift(), i / 2);
}
assertEq(arr.length, iters / 2);
for (var i = iters / 2; i < iters; i++)
assertEq(arr.shift(), i);
assertEq(arr.length, 0);
}
f();
|