Removed modifications to Array.prototype and moved them into OL.Util instead. All tests pass.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1590 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-10-05 15:18:02 +00:00
parent efa9499d57
commit 4739147a2f
12 changed files with 55 additions and 85 deletions
+5 -11
View File
@@ -30,21 +30,15 @@
}
function test_03_Util_Array(t) {
t.plan( 5 );
t.plan( 2 );
var array = new Array(1,2,3,4,5);
array.remove(3);
t.eq( array.toString(), "1,2,4,5", "array.remove works");
OpenLayers.Util.removeItem(array, 3);
t.eq( array.toString(), "1,2,4,5", "Util.removeItem works");
copy = array.clone();
t.eq( copy.toString(), "1,2,4,5", "array.clone() works");
array.push(7);
t.eq( copy.toString(), "1,2,4,5", "changing a value in the copied array doesnt affect the new array");
t.eq( copy.indexOf(5), 3, "indexOf function returns index of value in an array");
t.eq( copy.indexOf(75), -1, "indexOf function returns -1 when element not found in array");
OpenLayers.Util.clearArray(array);
t.eq( array.toString(), "", "Util.clearArray works");
}