blob: 5491b48b2d52e3ec982efb18441391a4ef2be948 [file] [log] [blame]
description(
"Tests that we can quickly sort a small sparse array that has a large length."
);
var array = [];
array[10000000] = 42;
array.sort();
var result = "";
for (var s in array) {
debug("array[" + s + "] = " + array[s]);
if (result)
result += ",";
result += array[s];
}
shouldBe("result", "\"42\"");
shouldBe("array.length", "10000001");
shouldBe("array[0]", "42");