add equals() function to OpenLayers.Bounds. plus test

git-svn-id: http://svn.openlayers.org/trunk/openlayers@389 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-26 02:42:58 +00:00
parent 1f89f13fb5
commit 75f9a6b2e0
2 changed files with 24 additions and 1 deletions

View File

@@ -163,7 +163,18 @@
t.eq( OpenLayers.Bounds.oppositeQuadrant("tr"), "bl", "OpenLayers.Bounds.oppositeQuadrant returns 'bl' for 'tr'");
t.eq( OpenLayers.Bounds.oppositeQuadrant("bl"), "tr", "OpenLayers.Bounds.oppositeQuadrant returns 'tr' for 'bl'");
t.eq( OpenLayers.Bounds.oppositeQuadrant("br"), "tl", "OpenLayers.Bounds.oppositeQuadrant returns 'tl' for 'br'");
}
}
function test_11_Bounds_equals(t) {
t.plan( 2 );
var boundsA = new OpenLayers.Bounds(1,2,3,4);
var boundsB = new OpenLayers.Bounds(1,2,3,4);
var boundsC = new OpenLayers.Bounds(1,5,3,4);
t.ok( boundsA.equals(boundsB), "equals() returns true on two equal bounds." );
t.ok( !boundsA.equals(boundsC), "equals() returns false on two different bounds." );
}
// -->
</script>
</head>