<commit_before><html>
<head>
  <script src="../lib/OpenLayers.js"></script>
  <script type="text/javascript"><!--
    var bounds; 
    function test_01_Bounds_constructor (t) {
        t.plan( 14 );
        bounds = new OpenLayers.Bounds(0,2,10,4);
        t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" );
        t.eq( bounds.CLASS_NAME, "OpenLayers.Bounds", "bounds.CLASS_NAME is set correctly" );
        t.eq( bounds.left, 0, "bounds.left is set correctly" );
        t.eq( bounds.bottom, 2, "bounds.bottom is set correctly" );
        t.eq( bounds.right, 10, "bounds.right is set correctly" );
        t.eq( bounds.top, 4, "bounds.top is set correctly" );
        t.eq( bounds.getWidth(), 10, "bounds.getWidth() returns correct value" );
        t.eq( bounds.getHeight(), 2, "bounds.getHeight() returns correct value" );
        
        var sz = bounds.getSize();
        t.eq( sz.w, 10, "bounds.getSize() has correct width value" );
        t.eq( sz.h, 2, "bounds.getSize() has correct height value" );
    
        var center = bounds.getCenterPixel();
        t.eq( center.x, 5, "bounds.getCenterPixel() has correct x value" );
        t.eq( center.y, 3, "bounds.getCenterPixel() has correct y value" );

        var center = bounds.getCenterLonLat();
        t.eq( center.lon, 5, "bounds.getCenterLonLat() has correct lon value" );
        t.eq( center.lat, 3, "bounds.getCenterLonLat() has correct lat value" );

     }

     function test_02_Bounds_toBBOX(t) {
         t.plan( 1 );
         bounds = new OpenLayers.Bounds(1,2,3,4);
         t.eq( bounds.toBBOX(), "1,2,3,4", "toBBOX() returns correct value." );
     }

     function test_03_Bounds_toString(t) {
         t.plan( 1 );
         bounds = new OpenLayers.Bounds(1,2,3,4);
         t.eq( bounds.toString(), "left-bottom=(1,2) right-top=(3,4)", "toString() returns correct value." ); 
     }

     function test_04_Bounds_contains(t) {
         t.plan( 4 );
         bounds = new OpenLayers.Bounds(10,10,40,40);
         t.eq( bounds.contains(20,20), true, "bounds(10,10,40,40) correctly contains LonLat(20,20)" );
         t.eq( bounds.contains(0,0), false, "bounds(10,10,40,40) correctly does not contain LonLat(0,0)" );
         t.eq( bounds.contains(40,40), true, "bounds(10,10,40,40) correctly contains LonLat(40,40) with inclusive set to true" );
         t.eq( bounds.contains(40,40, false), false, "bounds(10,10,40,40) correctly does not contain LonLat(40,40) with inclusive set to false" );
     }

     function test_05_Bounds_fromString_int(t) {
        t.plan( 10 );
        bounds = OpenLayers.Bounds.fromString("1,2,3,4");
        t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" );
        t.eq( bounds.left, 1, "bounds.left is set correctly" );
        t.eq( bounds.bottom, 2, "bounds.bottom is set correctly" );
        t.eq( bounds.right, 3, "bounds.right is set correctly" );
        t.eq( bounds.top, 4, "bounds.top is set correctly" );

        bounds = OpenLayers.Bounds.fromString("1.1,2.2,3.3,4.4");
        t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" );
        t.eq( bounds.left, 1.1, "bounds.left is set correctly" );
        t.eq( bounds.bottom, 2.2, "bounds.bottom is set correctly" );
        t.eq( bounds.right, 3.3, "bounds.right is set correctly" );
        t.eq( bounds.top, 4.4, "bounds.top is set correctly" );

     }

     function test_07_Bounds_copyOf(t) {
        t.plan( 6 );
        var oldBounds = new OpenLayers.Bounds(1,2,3,4);
        var bounds = oldBounds.copyOf();
        t.ok( bounds instanceof OpenLayers.Bounds, "copyOf returns new OpenLayers.Bounds object" );
        t.eq( bounds.left, 1, "bounds.left is set correctly" );
        t.eq( bounds.bottom, 2, "bounds.bottom is set correctly" );
        t.eq( bounds.right, 3, "bounds.right is set correctly" );
        t.eq( bounds.top, 4, "bounds.top is set correctly" );
        
        oldBounds.left = 100;
        t.eq( bounds.left, 1, "changing olBounds.left does not change bounds.left" );
     }

     function test_08_Bounds_containsBounds(t) {
         t.plan( 35 );
         containerBounds = new OpenLayers.Bounds(10,10,40,40);

         //totally outside
         bounds = new OpenLayers.Bounds(0,0,5,5);
         t.eq( containerBounds.containsBounds(bounds)              , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ")");
         t.eq( containerBounds.containsBounds(bounds, false)       , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false" );
         t.eq( containerBounds.containsBounds(bounds, false, true) , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, false, false), false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is false" );
         t.eq( containerBounds.containsBounds(bounds, true)        , false , "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is true" );
         t.eq( containerBounds.containsBounds(bounds, true, true)  , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is true, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, true, false) , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is true, inclusive is false" );

         //totally outside on border
         bounds = new OpenLayers.Bounds(15,0,30,10);
         t.eq( containerBounds.containsBounds(bounds)              , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ")");
         t.eq( containerBounds.containsBounds(bounds, false)       , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false" );
         t.eq( containerBounds.containsBounds(bounds, false, true) , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, false, false), false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is false" );
         t.eq( containerBounds.containsBounds(bounds, true)        , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true" );
         t.eq( containerBounds.containsBounds(bounds, true, true)  , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, true, false) , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is true, inclusive is false" );

         //partially inside
         bounds = new OpenLayers.Bounds(20,20,50,30);
         t.eq( containerBounds.containsBounds(bounds)              , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ")");
         t.eq( containerBounds.containsBounds(bounds, false)       , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false" );
         t.eq( containerBounds.containsBounds(bounds, false, true) , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, false, false), false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is false" );
         t.eq( containerBounds.containsBounds(bounds, true)        , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true" );
         t.eq( containerBounds.containsBounds(bounds, true, true)  , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, true, false) , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is false" );

         //totally inside on border
         bounds = new OpenLayers.Bounds(10,20,30,30);
         t.eq( containerBounds.containsBounds(bounds)              , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ")");
         t.eq( containerBounds.containsBounds(bounds, false)       , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is false" );
         t.eq( containerBounds.containsBounds(bounds, false, true) , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is false, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, false, false), false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is false" );
         t.eq( containerBounds.containsBounds(bounds, true)        , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true" );
         t.eq( containerBounds.containsBounds(bounds, true, true)  , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, true, false) , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is false" );

         //totally inside
         bounds = new OpenLayers.Bounds(20,20,30,30);
         t.eq( containerBounds.containsBounds(bounds)              , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ")");
         t.eq( containerBounds.containsBounds(bounds, false)       , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is false" );
         t.eq( containerBounds.containsBounds(bounds, false, true) , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is false, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, false, false), true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is false, inclusive is false" );
         t.eq( containerBounds.containsBounds(bounds, true)        , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true" );
         t.eq( containerBounds.containsBounds(bounds, true, true)  , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, true, false) , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is false" );
     }
     
     function test_09_Bounds_determineQuadrant(t) {

        t.plan( 4 );
        var bounds = new OpenLayers.Bounds(0,0,100,100);

        var tl = new OpenLayers.LonLat(25, 75);
        var tr = new OpenLayers.LonLat(75, 75);
        var bl = new OpenLayers.LonLat(25, 25);
        var br = new OpenLayers.LonLat(75, 25);

        t.eq( bounds.determineQuadrant(tl), "tl", "bounds.determineQuadrant correctly identifies a coordinate in the top left quadrant");
        t.eq( bounds.determineQuadrant(tr), "tr", "bounds.determineQuadrant correctly identifies a coordinate in the top right quadrant");
        t.eq( bounds.determineQuadrant(bl), "bl", "bounds.determineQuadrant correctly identifies a coordinate in the bottom left quadrant");
        t.eq( bounds.determineQuadrant(br), "br", "bounds.determineQuadrant correctly identifies a coordinate in the bottom right quadrant");
     }

     function test_10_Bounds_oppositeQuadrant(t) {

        t.plan( 4 );

        t.eq( OpenLayers.Bounds.oppositeQuadrant("tl"), "br", "OpenLayers.Bounds.oppositeQuadrant returns 'br' for 'tl'");
        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." );
     }

     function test_12_Bounds_getHeight_getWidth(t) {
         t.plan( 2 );
         var bounds = new OpenLayers.Bounds(10,20,100,120);

         t.eq( bounds.getWidth(), 90, "getWidth() works" );
         t.eq( bounds.getHeight(), 100, "getHeight() works" );

     }

     function test_13_Bounds_getCenters(t) {
         t.plan( 2 );
         var bounds = new OpenLayers.Bounds(0,20,100,120);

         t.ok( bounds.getCenterPixel().equals(new OpenLayers.Pixel(50, 70)), "getCenterPixel() works correctly");
         t.ok( bounds.getCenterLonLat().equals(new OpenLayers.LonLat(50, 70)), "getCenterLonLat() works correctly");
     }

  // -->
  </script>
</head>
<body>
</body>
</html>

<commit_msg>adding test for getSize() to OpenLayers.Bounds<commit_after><html>
<head>
  <script src="../lib/OpenLayers.js"></script>
  <script type="text/javascript"><!--
    var bounds; 
    function test_01_Bounds_constructor (t) {
        t.plan( 14 );
        bounds = new OpenLayers.Bounds(0,2,10,4);
        t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" );
        t.eq( bounds.CLASS_NAME, "OpenLayers.Bounds", "bounds.CLASS_NAME is set correctly" );
        t.eq( bounds.left, 0, "bounds.left is set correctly" );
        t.eq( bounds.bottom, 2, "bounds.bottom is set correctly" );
        t.eq( bounds.right, 10, "bounds.right is set correctly" );
        t.eq( bounds.top, 4, "bounds.top is set correctly" );
        t.eq( bounds.getWidth(), 10, "bounds.getWidth() returns correct value" );
        t.eq( bounds.getHeight(), 2, "bounds.getHeight() returns correct value" );
        
        var sz = bounds.getSize();
        t.eq( sz.w, 10, "bounds.getSize() has correct width value" );
        t.eq( sz.h, 2, "bounds.getSize() has correct height value" );
    
        var center = bounds.getCenterPixel();
        t.eq( center.x, 5, "bounds.getCenterPixel() has correct x value" );
        t.eq( center.y, 3, "bounds.getCenterPixel() has correct y value" );

        var center = bounds.getCenterLonLat();
        t.eq( center.lon, 5, "bounds.getCenterLonLat() has correct lon value" );
        t.eq( center.lat, 3, "bounds.getCenterLonLat() has correct lat value" );

     }

     function test_02_Bounds_toBBOX(t) {
         t.plan( 1 );
         bounds = new OpenLayers.Bounds(1,2,3,4);
         t.eq( bounds.toBBOX(), "1,2,3,4", "toBBOX() returns correct value." );
     }

     function test_03_Bounds_toString(t) {
         t.plan( 1 );
         bounds = new OpenLayers.Bounds(1,2,3,4);
         t.eq( bounds.toString(), "left-bottom=(1,2) right-top=(3,4)", "toString() returns correct value." ); 
     }

     function test_04_Bounds_contains(t) {
         t.plan( 4 );
         bounds = new OpenLayers.Bounds(10,10,40,40);
         t.eq( bounds.contains(20,20), true, "bounds(10,10,40,40) correctly contains LonLat(20,20)" );
         t.eq( bounds.contains(0,0), false, "bounds(10,10,40,40) correctly does not contain LonLat(0,0)" );
         t.eq( bounds.contains(40,40), true, "bounds(10,10,40,40) correctly contains LonLat(40,40) with inclusive set to true" );
         t.eq( bounds.contains(40,40, false), false, "bounds(10,10,40,40) correctly does not contain LonLat(40,40) with inclusive set to false" );
     }

     function test_05_Bounds_fromString_int(t) {
        t.plan( 10 );
        bounds = OpenLayers.Bounds.fromString("1,2,3,4");
        t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" );
        t.eq( bounds.left, 1, "bounds.left is set correctly" );
        t.eq( bounds.bottom, 2, "bounds.bottom is set correctly" );
        t.eq( bounds.right, 3, "bounds.right is set correctly" );
        t.eq( bounds.top, 4, "bounds.top is set correctly" );

        bounds = OpenLayers.Bounds.fromString("1.1,2.2,3.3,4.4");
        t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" );
        t.eq( bounds.left, 1.1, "bounds.left is set correctly" );
        t.eq( bounds.bottom, 2.2, "bounds.bottom is set correctly" );
        t.eq( bounds.right, 3.3, "bounds.right is set correctly" );
        t.eq( bounds.top, 4.4, "bounds.top is set correctly" );

     }

     function test_06_Bounds_getSize(t) {
         t.plan( 1 );
         var bounds = new OpenLayers.Bounds(0,10,100,120);

         t.ok( bounds.getSize().equals(new OpenLayers.Size(100, 110)), "getCenterPixel() works correctly");
     }
     
     function test_07_Bounds_copyOf(t) {
        t.plan( 6 );
        var oldBounds = new OpenLayers.Bounds(1,2,3,4);
        var bounds = oldBounds.copyOf();
        t.ok( bounds instanceof OpenLayers.Bounds, "copyOf returns new OpenLayers.Bounds object" );
        t.eq( bounds.left, 1, "bounds.left is set correctly" );
        t.eq( bounds.bottom, 2, "bounds.bottom is set correctly" );
        t.eq( bounds.right, 3, "bounds.right is set correctly" );
        t.eq( bounds.top, 4, "bounds.top is set correctly" );
        
        oldBounds.left = 100;
        t.eq( bounds.left, 1, "changing olBounds.left does not change bounds.left" );
     }

     function test_08_Bounds_containsBounds(t) {
         t.plan( 35 );
         containerBounds = new OpenLayers.Bounds(10,10,40,40);

         //totally outside
         bounds = new OpenLayers.Bounds(0,0,5,5);
         t.eq( containerBounds.containsBounds(bounds)              , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ")");
         t.eq( containerBounds.containsBounds(bounds, false)       , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false" );
         t.eq( containerBounds.containsBounds(bounds, false, true) , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, false, false), false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is false" );
         t.eq( containerBounds.containsBounds(bounds, true)        , false , "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is true" );
         t.eq( containerBounds.containsBounds(bounds, true, true)  , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is true, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, true, false) , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is true, inclusive is false" );

         //totally outside on border
         bounds = new OpenLayers.Bounds(15,0,30,10);
         t.eq( containerBounds.containsBounds(bounds)              , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ")");
         t.eq( containerBounds.containsBounds(bounds, false)       , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false" );
         t.eq( containerBounds.containsBounds(bounds, false, true) , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, false, false), false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is false" );
         t.eq( containerBounds.containsBounds(bounds, true)        , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true" );
         t.eq( containerBounds.containsBounds(bounds, true, true)  , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, true, false) , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is true, inclusive is false" );

         //partially inside
         bounds = new OpenLayers.Bounds(20,20,50,30);
         t.eq( containerBounds.containsBounds(bounds)              , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ")");
         t.eq( containerBounds.containsBounds(bounds, false)       , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false" );
         t.eq( containerBounds.containsBounds(bounds, false, true) , false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, false, false), false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is false" );
         t.eq( containerBounds.containsBounds(bounds, true)        , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true" );
         t.eq( containerBounds.containsBounds(bounds, true, true)  , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, true, false) , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is false" );

         //totally inside on border
         bounds = new OpenLayers.Bounds(10,20,30,30);
         t.eq( containerBounds.containsBounds(bounds)              , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ")");
         t.eq( containerBounds.containsBounds(bounds, false)       , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is false" );
         t.eq( containerBounds.containsBounds(bounds, false, true) , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is false, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, false, false), false, "(" + containerBounds.toBBOX() + ") correctly does not contain (" + bounds.toBBOX() + ") when partial is false, inclusive is false" );
         t.eq( containerBounds.containsBounds(bounds, true)        , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true" );
         t.eq( containerBounds.containsBounds(bounds, true, true)  , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, true, false) , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is false" );

         //totally inside
         bounds = new OpenLayers.Bounds(20,20,30,30);
         t.eq( containerBounds.containsBounds(bounds)              , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ")");
         t.eq( containerBounds.containsBounds(bounds, false)       , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is false" );
         t.eq( containerBounds.containsBounds(bounds, false, true) , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is false, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, false, false), true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is false, inclusive is false" );
         t.eq( containerBounds.containsBounds(bounds, true)        , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true" );
         t.eq( containerBounds.containsBounds(bounds, true, true)  , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is true" );
         t.eq( containerBounds.containsBounds(bounds, true, false) , true, "(" + containerBounds.toBBOX() + ") correctly contains (" + bounds.toBBOX() + ") when partial is true, inclusive is false" );
     }
     
     function test_09_Bounds_determineQuadrant(t) {

        t.plan( 4 );
        var bounds = new OpenLayers.Bounds(0,0,100,100);

        var tl = new OpenLayers.LonLat(25, 75);
        var tr = new OpenLayers.LonLat(75, 75);
        var bl = new OpenLayers.LonLat(25, 25);
        var br = new OpenLayers.LonLat(75, 25);

        t.eq( bounds.determineQuadrant(tl), "tl", "bounds.determineQuadrant correctly identifies a coordinate in the top left quadrant");
        t.eq( bounds.determineQuadrant(tr), "tr", "bounds.determineQuadrant correctly identifies a coordinate in the top right quadrant");
        t.eq( bounds.determineQuadrant(bl), "bl", "bounds.determineQuadrant correctly identifies a coordinate in the bottom left quadrant");
        t.eq( bounds.determineQuadrant(br), "br", "bounds.determineQuadrant correctly identifies a coordinate in the bottom right quadrant");
     }

     function test_10_Bounds_oppositeQuadrant(t) {

        t.plan( 4 );

        t.eq( OpenLayers.Bounds.oppositeQuadrant("tl"), "br", "OpenLayers.Bounds.oppositeQuadrant returns 'br' for 'tl'");
        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." );
     }

     function test_12_Bounds_getHeight_getWidth(t) {
         t.plan( 2 );
         var bounds = new OpenLayers.Bounds(10,20,100,120);

         t.eq( bounds.getWidth(), 90, "getWidth() works" );
         t.eq( bounds.getHeight(), 100, "getHeight() works" );

     }

     function test_13_Bounds_getCenters(t) {
         t.plan( 2 );
         var bounds = new OpenLayers.Bounds(0,20,100,120);

         t.ok( bounds.getCenterPixel().equals(new OpenLayers.Pixel(50, 70)), "getCenterPixel() works correctly");
         t.ok( bounds.getCenterLonLat().equals(new OpenLayers.LonLat(50, 70)), "getCenterLonLat() works correctly");
     }

  // -->
  </script>
</head>
<body>
</body>
</html>


{'fraction_non_alphanumeric': 0.15170082400169027, 'fraction_numerical': 0.02105782097330798, 'mean_word_length': 3.1763235294117647, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3674174', 'n_tokens_mistral': 9026, 'n_tokens_neox': 8542, 'n_words': 2202}