Fix broken test of new Bounds.intersectBounds, add test to ensure it doesn't

break again in the future. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1530 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-10-03 01:05:42 +00:00
parent 07fc49ab31
commit 66a5d90965
2 changed files with 14 additions and 3 deletions
+3 -1
View File
@@ -108,15 +108,17 @@
}
function test_08a_Bounds_intersectsBounds(t) {
t.plan( 15 );
t.plan( 16 );
var aBounds = new OpenLayers.Bounds(-180, -90, 180, 90);
//inside
var bBounds = new OpenLayers.Bounds(-20, -10, 20, 10);
var cBounds = new OpenLayers.Bounds(-181,-90,180,90);
t.eq( aBounds.intersectsBounds(bBounds), true, "(" + aBounds.toBBOX() + ") correctly intersects (" + bBounds.toBBOX() + ")" );
t.eq( aBounds.intersectsBounds(bBounds, true), true, "(" + aBounds.toBBOX() + ") correctly intersects (" + bBounds.toBBOX() + "), inclusive is true" );
t.eq( aBounds.intersectsBounds(bBounds, false), true, "(" + aBounds.toBBOX() + ") correctly intersects (" + bBounds.toBBOX() + "), inclusive is false" );
t.eq( cBounds.intersectsBounds(aBounds, false), true, "cBounds with aBounds adjusted one degree left passes intersect bounds. (3 sides match, 1 side different)." );
//outside
bBounds = new OpenLayers.Bounds(-181, -91, 181, 91);