<commit_before><html>
<head>
  <script src="../lib/OpenLayers.js"></script>
  <script type="text/javascript"><!--
    var layer; 

    function test_01_Layer_WMS_constructor (t) {
	    t.plan( 6 );
	    
	    layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/png'});
	    t.ok( layer instanceof OpenLayers.Layer.WMS, "new OpenLayers.Layer.WMS returns object" );
	    t.eq( layer.name, "Test Layer", "layer.name is correct" );
	    t.eq( layer.url, "http://octo.metacarta.com/cgi-bin/mapserv", "layer.url is correct" );
	    t.eq( layer.params.map, "/mapdata/vmap_wms.map", "layer.params.map is correct" );
	    t.eq( layer.params.format, "image/png", "layer.params.format is correctly overridden" );
            t.eq( layer.params.exceptions, "application/vnd.ogc.se_inimage", 
                                    "other default layer.params are set correctly" );
    }
    function test_02_Layer_WMS_addtile (t) {
        t.plan( 6 );
	    layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'});
        var pixel = new OpenLayers.Pixel(5,6);
        var tile = layer.addTile(new OpenLayers.Bounds(1,2,3,4), pixel);
        t.eq( tile.img.src, "http://octo.metacarta.com/cgi-bin/mapserv?bbox=1,2,3,4&width=256&height=256&map=/mapdata/vmap_wms.map&layers=basic&format=image/jpeg&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:4326&styles=&exceptions=application/vnd.ogc.se_inimage", "image src is created correctly via addtile" );
        t.eq( tile.img.style.top, "6px", "image top is set correctly via addtile" );
        t.eq( tile.img.style.left, "5px", "image top is set correctly via addtile" );
        t.ok( layer.div.firstChild instanceof HTMLImageElement, "div first child is an image object" );
        t.eq( layer.div.firstChild.src, "http://octo.metacarta.com/cgi-bin/mapserv?bbox=1,2,3,4&width=256&height=256&map=/mapdata/vmap_wms.map&layers=basic&format=image/jpeg&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:4326&styles=&exceptions=application/vnd.ogc.se_inimage", "div first child is correct image object" );
        var pos = tile.getPosition();
        t.eq( pos.toString(), "x=5,y=6", "Position of tile is set correctly." );
    }

    function test_99_Layer_WMS_destroy (t) {
	    t.plan( 1 );	
	    layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'});
	    layer.destroy();
	    t.eq( layer.map, null, "layer.map is null after destroy" );
    }
  // -->
  </script>
</head>
<body>
</body>
</html><commit_msg>Commit initial tests for inittiles.<commit_after><html>
<head>
  <script src="../lib/OpenLayers.js"></script>
  <script type="text/javascript"><!--
    var layer; 

    function test_01_Layer_WMS_constructor (t) {
	    t.plan( 6 );
	    
	    layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/png'});
	    t.ok( layer instanceof OpenLayers.Layer.WMS, "new OpenLayers.Layer.WMS returns object" );
	    t.eq( layer.name, "Test Layer", "layer.name is correct" );
	    t.eq( layer.url, "http://octo.metacarta.com/cgi-bin/mapserv", "layer.url is correct" );
	    t.eq( layer.params.map, "/mapdata/vmap_wms.map", "layer.params.map is correct" );
	    t.eq( layer.params.format, "image/png", "layer.params.format is correctly overridden" );
            t.eq( layer.params.exceptions, "application/vnd.ogc.se_inimage", 
                                    "other default layer.params are set correctly" );
    }
    function test_02_Layer_WMS_addtile (t) {
        t.plan( 6 );
	    layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'});
        var pixel = new OpenLayers.Pixel(5,6);
        var tile = layer.addTile(new OpenLayers.Bounds(1,2,3,4), pixel);
        t.eq( tile.img.src, "http://octo.metacarta.com/cgi-bin/mapserv?bbox=1,2,3,4&width=256&height=256&map=/mapdata/vmap_wms.map&layers=basic&format=image/jpeg&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:4326&styles=&exceptions=application/vnd.ogc.se_inimage", "image src is created correctly via addtile" );
        t.eq( tile.img.style.top, "6px", "image top is set correctly via addtile" );
        t.eq( tile.img.style.left, "5px", "image top is set correctly via addtile" );
        t.ok( layer.div.firstChild instanceof HTMLImageElement, "div first child is an image object" );
        t.eq( layer.div.firstChild.src, "http://octo.metacarta.com/cgi-bin/mapserv?bbox=1,2,3,4&width=256&height=256&map=/mapdata/vmap_wms.map&layers=basic&format=image/jpeg&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:4326&styles=&exceptions=application/vnd.ogc.se_inimage", "div first child is correct image object" );
        var pos = tile.getPosition();
        t.eq( pos.toString(), "x=5,y=6", "Position of tile is set correctly." );
    }
    function test_03_Layer_WMS_inittiles (t) {
        t.plan( 2 );
        var map = new OpenLayers.Map($('map'));
	    layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'});
        map.addLayer(layer);
        map.setCenter(new OpenLayers.LonLat(0,0),5);
        t.eq( layer.grid.length, 4, "Grid rows is correct." );
        t.eq( layer.grid[0].length, 2, "Grid cols is correct." );
        
    }

    function test_99_Layer_WMS_destroy (t) {
	    t.plan( 1 );	
	    layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'});
	    layer.destroy();
	    t.eq( layer.map, null, "layer.map is null after destroy" );
    }
  // -->
  </script>
</head>
<body>
<div id="map" style="width:500px;height:550px"></div>
</body>
</html>
{'fraction_non_alphanumeric': 0.17454604940291182, 'fraction_numerical': 0.019793881891051857, 'mean_word_length': 3.4758418740849195, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2456256', 'n_tokens_mistral': 2357, 'n_tokens_neox': 2210, 'n_words': 413}