diff --git a/tests/Control/OverviewMap.html b/tests/Control/OverviewMap.html index fce7a24d28..30cac5dff0 100644 --- a/tests/Control/OverviewMap.html +++ b/tests/Control/OverviewMap.html @@ -3,19 +3,23 @@ -
+
diff --git a/tests/Format/WKT.html b/tests/Format/WKT.html index 15d2b2cf62..bdfc2337bc 100644 --- a/tests/Format/WKT.html +++ b/tests/Format/WKT.html @@ -254,21 +254,40 @@ t.plan(1); var projections = { - src: new OpenLayers.Projection("EPSG:4326"), - dest: new OpenLayers.Projection("EPSG:900913") - }; - - var points = { - src: new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(-87.9, 41.9)), - dest: new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(-9784983.2393667, 5146011.6785665)) - }; - - var format = new OpenLayers.Format.WKT({ - externalProjection: projections["src"], - internalProjection: projections["dest"] - }); - var feature = format.read("GEOMETRYCOLLECTION(POINT(" + points["src"].geometry.x + " " + points["src"].geometry.y + "))")[0]; - t.eq(feature.geometry.toString(), points["dest"].geometry.toString(), + src: new OpenLayers.Projection("EPSG:4326"), + dest: new OpenLayers.Projection("EPSG:900913") + }, + points = { + src: new OpenLayers.Feature.Vector( + new OpenLayers.Geometry.Point(-87.9, 41.9) + ), + dest: new OpenLayers.Feature.Vector( + new OpenLayers.Geometry.Point(-9784983.2393667, 5146011.6785665) + ) + }, + format = new OpenLayers.Format.WKT({ + externalProjection: projections["src"], + internalProjection: projections["dest"] + }), + gc_wkt_parts = [ + "GEOMETRYCOLLECTION(", + "POINT(", + points["src"].geometry.x, + " ", + points["src"].geometry.y, + ")", + ")" + ], + feature = format.read( gc_wkt_parts.join("") )[0], + gotGeom = feature.geometry, + expectGeom = points["dest"].geometry, + // we don't use geometry::toString because we might run into + // precision issues + precision = 7, + got = gotGeom.x.toFixed(precision) + ' ' + gotGeom.y.toFixed(precision), + expected = expectGeom.x.toFixed(precision) + ' ' + expectGeom.y.toFixed(precision); + + t.eq(got, expected, "Geometry collections aren't transformed twice when reprojection."); } diff --git a/tests/Format/XML.html b/tests/Format/XML.html index 8da8fbf1e3..ff663c3f5e 100644 --- a/tests/Format/XML.html +++ b/tests/Format/XML.html @@ -147,7 +147,7 @@ var uri = "http://foo.com"; var prefix = "foo"; var localName = "bar"; - var qualifiedName = prefix + ":" + name; + var qualifiedName = prefix + ":" + localName; var node = format.createElementNS(uri, qualifiedName); t.eq(node.nodeType, 1, "node has correct type"); diff --git a/tests/Strategy/BBOX.html b/tests/Strategy/BBOX.html index aa66c65321..84c0ad02ee 100644 --- a/tests/Strategy/BBOX.html +++ b/tests/Strategy/BBOX.html @@ -88,9 +88,26 @@ strategy.update({force: true}); var from = map.getProjectionObject(); var to = layer.projection; - t.eq(strategy.bounds.toString(), map.getExtent().transform(from, to).toString(), "[force update different proj] bounds transformed"); - + var strategyBounds = strategy.bounds, + mapExtent = map.getExtent().transform(from, to), + // we don't use bounds::toString because we might run into + // precision issues + precision = 7, + strategyBoundsGot = [ + strategyBounds.left.toFixed( precision ), + strategyBounds.bottom.toFixed( precision ), + strategyBounds.right.toFixed( precision ), + strategyBounds.top.toFixed( precision ) + ].join(','), + mapExtentExpected = [ + mapExtent.left.toFixed( precision ), + mapExtent.bottom.toFixed( precision ), + mapExtent.right.toFixed( precision ), + mapExtent.top.toFixed( precision ) + ].join(','); + t.eq(strategyBoundsGot, mapExtentExpected, + "[force update different proj] bounds transformed"); } function test_events(t) {