[OpenLayers-Commits] r2376 - in sandbox/vector-2.4/tests: . Geometry

commits at openlayers.org commits at openlayers.org
Mon Mar 5 22:53:46 EST 2007


Author: euzuro
Date: 2007-03-05 22:53:39 -0500 (Mon, 05 Mar 2007)
New Revision: 2376

Added:
   sandbox/vector-2.4/tests/Geometry/test_LinearRing.html
Modified:
   sandbox/vector-2.4/tests/list-tests.html
Log:
add stock test for linear ring

Added: sandbox/vector-2.4/tests/Geometry/test_LinearRing.html
===================================================================
--- sandbox/vector-2.4/tests/Geometry/test_LinearRing.html	                        (rev 0)
+++ sandbox/vector-2.4/tests/Geometry/test_LinearRing.html	2007-03-06 03:53:39 UTC (rev 2376)
@@ -0,0 +1,31 @@
+<html>
+<head>
+  <script src="../../lib/OpenLayers.js"></script>
+  <script type="text/javascript"><!--
+    var line;
+    var path = [new OpenLayers.Geometry.Point(10,10), new OpenLayers.Geometry.Point(0,0)];
+        
+    function test_01_LinearRing_constructor (t) {
+        t.plan( 3 );
+        line = new OpenLayers.Geometry.LineString();
+        t.ok( line instanceof OpenLayers.Geometry.LineString, "new OpenLayers.Geometry.LineString returns line object" );
+        t.eq( line.CLASS_NAME, "OpenLayers.Geometry.LineString", "line.CLASS_NAME is set correctly");
+        t.eq( line.path, [], "line.path is set correctly");
+    }
+
+    function test_01a_LinearRing_constructor (t) {
+        t.plan( 3 );
+        line = new OpenLayers.Geometry.LineString(path);
+        t.ok( line instanceof OpenLayers.Geometry.LineString, "new OpenLayers.Geometry.LineString returns line object" );
+        t.eq( line.CLASS_NAME, "OpenLayers.Geometry.LineString", "line.CLASS_NAME is set correctly");
+        // TBD FIXME, recursion
+        // t.eq( line.path, path, "line.path is set correctly");
+        t.eq( line.path.length, 2, "line.path.length is set correctly");
+    }
+
+  // -->
+  </script>
+</head>
+<body>
+</body>
+</html>

Modified: sandbox/vector-2.4/tests/list-tests.html
===================================================================
--- sandbox/vector-2.4/tests/list-tests.html	2007-03-06 03:46:22 UTC (rev 2375)
+++ sandbox/vector-2.4/tests/list-tests.html	2007-03-06 03:53:39 UTC (rev 2376)
@@ -8,6 +8,7 @@
     <li>Geometry/test_Point.html</li>
     <li>Geometry/test_Curve.html</li>
     <li>Geometry/test_LineString.html</li>
+    <li>Geometry/test_LinearRing.html</li>
     <li>Geometry/test_Collection.html</li>
     <li>Geometry/test_MultiPoint.html</li>
     <li>Geometry/test_Polygon.html</li>



More information about the Commits mailing list