Changeset: 9f13ceefb1ce for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9f13ceefb1ce
Added Files:
        geom/sql/functions/Tests/ST_AsEWKT.test
        geom/sql/functions/Tests/ST_AsText.test
        geom/sql/functions/Tests/ST_Boundary.test
        geom/sql/functions/Tests/ST_Contains.test
        geom/sql/functions/Tests/ST_CoordDim.test
        geom/sql/functions/Tests/ST_Dimension.test
        geom/sql/functions/Tests/ST_GeomFromText.test
        geom/sql/functions/Tests/ST_GeometryN.test
        geom/sql/functions/Tests/ST_GeometryType.test
        geom/sql/functions/Tests/ST_IsClosed.test
        geom/sql/functions/Tests/ST_IsEmpty.test
        geom/sql/functions/Tests/ST_IsRing.test
        geom/sql/functions/Tests/ST_IsSimple.test
        geom/sql/functions/Tests/ST_IsValid.test
        geom/sql/functions/Tests/ST_LineFromText.test
        geom/sql/functions/Tests/ST_MLineFromText.test
        geom/sql/functions/Tests/ST_MPointFromText.test
        geom/sql/functions/Tests/ST_MPolygonFromText.test
        geom/sql/functions/Tests/ST_MakeBox2D.test
        geom/sql/functions/Tests/ST_MakePoint.test
        geom/sql/functions/Tests/ST_NPoints.test
        geom/sql/functions/Tests/ST_NRings.test
        geom/sql/functions/Tests/ST_NumGeometries.test
        geom/sql/functions/Tests/ST_NumInteriorRings.test
        geom/sql/functions/Tests/ST_NumPoints.test
        geom/sql/functions/Tests/ST_PointFromText.test
        geom/sql/functions/Tests/ST_PolygonFromText.test
        geom/sql/functions/Tests/XYZ.test
        geom/sql/functions/Tests/XYZMinMax.test
        geom/sql/functions/Tests/dropTestGeometries.test
        geom/sql/functions/Tests/dropTestWKT.test
        geom/sql/functions/Tests/loadTestGeometries.test
        geom/sql/functions/Tests/loadTestWKT.test
Modified Files:
        geom/sql/functions/Tests/All
Branch: mtest
Log Message:

Convert the tests in geom/sql/functions

Failure of the test ST_IsSimple has been preserved
from the original.


diffs (truncated from 2805 to 300 lines):

diff --git a/geom/sql/functions/Tests/All b/geom/sql/functions/Tests/All
--- a/geom/sql/functions/Tests/All
+++ b/geom/sql/functions/Tests/All
@@ -18,11 +18,11 @@ HAVE_GEOM?loadTestGeometries
 HAVE_GEOM?ST_GeometryType
 HAVE_GEOM?ST_AsText
 
-HAVE_GEOM?ST_IsClosed #ignores Z coordinate
-HAVE_GEOM?ST_IsEmpty 
-HAVE_GEOM?ST_IsSimple #ignores Z coordinate
-HAVE_GEOM?ST_IsValid #ignores Z coordinate
-HAVE_GEOM?ST_IsRing #ignores Z coordinate
+HAVE_GEOM?ST_IsClosed
+HAVE_GEOM?ST_IsEmpty
+HAVE_GEOM?ST_IsSimple
+HAVE_GEOM?ST_IsValid
+HAVE_GEOM?ST_IsRing
 
 HAVE_GEOM?XYZ
 HAVE_GEOM?XYZMinMax
@@ -37,11 +37,11 @@ HAVE_GEOM?ST_NRings
 
 #HAVE_GEOM?transform
 
-HAVE_GEOM?ST_Contains #ignores Z coordinate
+HAVE_GEOM?ST_Contains
 
 #HAVE_GEOM?equals
 
-HAVE_GEOM?ST_Boundary #Missing geom_bat + bat_geom
+HAVE_GEOM?ST_Boundary
 
 HAVE_GEOM?ST_Dimension
 HAVE_GEOM?ST_CoordDim
diff --git a/geom/sql/functions/Tests/ST_AsEWKT.test 
b/geom/sql/functions/Tests/ST_AsEWKT.test
new file mode 100644
--- /dev/null
+++ b/geom/sql/functions/Tests/ST_AsEWKT.test
@@ -0,0 +1,220 @@
+query T rowsort
+select st_asEWKT(st_pointfromtext('point(10 10)'))
+----
+SRID:0;POINT (10 10)
+
+query T rowsort
+select st_asEWKT(st_pointfromtext('point(20 20)', 4326))
+----
+SRID:4326;POINT (20 20)
+
+query T rowsort
+select st_asEWKT(st_pointfromtext('point(10 10 10)'))
+----
+SRID:0;POINT Z (10 10 10)
+
+query T rowsort
+select st_asEWKT(st_makepoint(10, 10))
+----
+SRID:0;POINT (10 10)
+
+query T rowsort
+select st_asEWKT(st_point(20, 20))
+----
+SRID:0;POINT (20 20)
+
+query T rowsort
+select st_asEWKT(st_makepoint(10, 10, 10))
+----
+SRID:0;POINT Z (10 10 10)
+
+query T rowsort
+select st_asEWKT(st_linefromtext('linestring(10 10, 20 20, 30 30)'))
+----
+SRID:0;LINESTRING (10 10, 20 20, 30 30)
+
+query T rowsort
+select st_asEWKT(st_linefromtext('linestring(20 20, 30 30, 40 40)', 4326))
+----
+SRID:4326;LINESTRING (20 20, 30 30, 40 40)
+
+query T rowsort
+select st_asEWKT(st_linefromtext('linestring(20 20 20, 30 30 30, 40 40 40)', 
4326))
+----
+SRID:4326;LINESTRING Z (20 20 20, 30 30 30, 40 40 40)
+
+query T rowsort
+select st_asEWKT(st_polygonfromtext('polygon((10 10, 20 20, 30 30, 10 10))'))
+----
+SRID:0;POLYGON ((10 10, 20 20, 30 30, 10 10))
+
+query T rowsort
+select st_asEWKT(st_polygonfromtext('polygon((20 20, 30 30, 40 40, 20 20))', 
4326))
+----
+SRID:4326;POLYGON ((20 20, 30 30, 40 40, 20 20))
+
+query T rowsort
+select st_asEWKT(st_polygonfromtext('polygon((10 10 10, 20 20 20, 30 30 30, 10 
10 10))'))
+----
+SRID:0;POLYGON Z ((10 10 10, 20 20 20, 30 30 30, 10 10 10))
+
+query T rowsort
+select st_asEWKT(st_mpointfromtext('multipoint(10 10, 20 20)'))
+----
+SRID:0;MULTIPOINT (10 10, 20 20)
+
+query T rowsort
+select st_asEWKT(st_mpointfromtext('multipoint(20 20, 30 30)', 4326))
+----
+SRID:4326;MULTIPOINT (20 20, 30 30)
+
+query T rowsort
+select st_asEWKT(st_mpointfromtext('multipoint(20 20 20, 30 30 30)', 4326))
+----
+SRID:4326;MULTIPOINT Z (20 20 20, 30 30 30)
+
+query T rowsort
+select st_asEWKT(st_mlinefromtext('multilinestring((10 10, 20 20, 30 30), (40 
40, 50 50, 60 60))'))
+----
+SRID:0;MULTILINESTRING ((10 10, 20 20, 30 30), (40 40, 50 50, 60 60))
+
+query T rowsort
+select st_asEWKT(st_mlinefromtext('multilinestring((20 20, 30 30, 40 40), (50 
50, 60 60, 70 70))', 4326))
+----
+SRID:4326;MULTILINESTRING ((20 20, 30 30, 40 40), (50 50, 60 60, 70 70))
+
+query T rowsort
+select st_asEWKT(st_mlinefromtext('multilinestring((20 20 20, 30 30 30, 40 40 
40), (50 50 50, 60 60 60, 70 70 70))', 4326))
+----
+SRID:4326;MULTILINESTRING Z ((20 20 20, 30 30 30, 40 40 40), (50 50 50, 60 60 
60, 70 70 70))
+
+query T rowsort
+select st_asEWKT(st_mpolyfromtext('multipolygon(((10 10, 20 20, 30 30, 10 
10),(100 100, 200 200, 300 300, 100 100)))'))
+----
+SRID:0;MULTIPOLYGON (((10 10, 20 20, 30 30, 10 10), (100 100, 200 200, 300 
300, 100 100)))
+
+query T rowsort
+select st_asEWKT(st_mpolyfromtext('multipolygon(((20 20, 30 30, 40 40, 20 
20),(200 200, 300 300, 400 400, 200 200)))', 4326))
+----
+SRID:4326;MULTIPOLYGON (((20 20, 30 30, 40 40, 20 20), (200 200, 300 300, 400 
400, 200 200)))
+
+query T rowsort
+select st_asEWKT(st_mpolyfromtext('multipolygon(((10 10 10, 20 20 20, 30 30 
30, 10 10 10),(100 100 100, 200 200 200, 300 300 300, 100 100 100)))'))
+----
+SRID:0;MULTIPOLYGON Z (((10 10 10, 20 20 20, 30 30 30, 10 10 10), (100 100 
100, 200 200 200, 300 300 300, 100 100 100)))
+
+query T rowsort
+select st_asEWKT(st_geomfromtext('point(10 10)'))
+----
+SRID:0;POINT (10 10)
+
+query T rowsort
+select st_asEWKT(st_geomfromtext('linestring(10 10, 20 20, 30 30)'))
+----
+SRID:0;LINESTRING (10 10, 20 20, 30 30)
+
+query T rowsort
+select st_asEWKT(st_geomfromtext('polygon((10 10, 20 20, 30 30, 10 10))'))
+----
+SRID:0;POLYGON ((10 10, 20 20, 30 30, 10 10))
+
+query T rowsort
+select st_asEWKT(st_geomfromtext('multipoint(10 10, 20 20)'))
+----
+SRID:0;MULTIPOINT (10 10, 20 20)
+
+query T rowsort
+select st_asEWKT(st_geomfromtext('multilinestring((10 10, 20 20, 30 30), (40 
40, 50 50, 60 60))'))
+----
+SRID:0;MULTILINESTRING ((10 10, 20 20, 30 30), (40 40, 50 50, 60 60))
+
+query T rowsort
+select st_asEWKT(st_geomfromtext('multipolygon(((10 10, 20 20, 30 30, 10 
10),(100 100, 200 200, 300 300, 100 100)))'))
+----
+SRID:0;MULTIPOLYGON (((10 10, 20 20, 30 30, 10 10), (100 100, 200 200, 300 
300, 100 100)))
+
+statement ok
+create table points_tbl(g geometry(point))
+
+statement ok
+insert into points_tbl values (st_pointfromtext('point(10 10)'))
+
+query T rowsort
+select st_asEWKT(g) from points_tbl
+----
+SRID:0;POINT (10 10)
+
+statement ok
+drop table points_tbl
+
+statement ok
+create table lines_tbl(g geometry(linestring))
+
+statement ok
+insert into lines_tbl values (st_linefromtext('linestring(10 10, 20 20, 30 
30)'))
+
+query T rowsort
+select st_asEWKT(g) from lines_tbl
+----
+SRID:0;LINESTRING (10 10, 20 20, 30 30)
+
+statement ok
+drop table lines_tbl
+
+statement ok
+create table polygons_tbl(g geometry(polygon))
+
+statement ok
+insert into polygons_tbl values (st_polygonfromtext('polygon((10 10, 20 20, 30 
30, 10 10))'))
+
+query T rowsort
+select st_asEWKT(g) from polygons_tbl
+----
+SRID:0;POLYGON ((10 10, 20 20, 30 30, 10 10))
+
+statement ok
+drop table polygons_tbl
+
+statement ok
+create table points_tbl(g geometry(pointz))
+
+statement ok
+insert into points_tbl values (st_pointfromtext('point(10 10 10)'))
+
+query T rowsort
+select st_asEWKT(g) from points_tbl
+----
+SRID:0;POINT Z (10 10 10)
+
+statement ok
+drop table points_tbl
+
+statement ok
+create table lines_tbl(g geometry(linestringz))
+
+statement ok
+insert into lines_tbl values (st_linefromtext('linestring(10 10 10, 20 20 20, 
30 30 30)'))
+
+query T rowsort
+select st_asEWKT(g) from lines_tbl
+----
+SRID:0;LINESTRING Z (10 10 10, 20 20 20, 30 30 30)
+
+statement ok
+drop table lines_tbl
+
+statement ok
+create table polygons_tbl(g geometry(polygonz))
+
+statement ok
+insert into polygons_tbl values (st_polygonfromtext('polygon((10 10 10, 20 20 
20, 30 30 30, 10 10 10))'))
+
+query T rowsort
+select st_asEWKT(g) from polygons_tbl
+----
+SRID:0;POLYGON Z ((10 10 10, 20 20 20, 30 30 30, 10 10 10))
+
+statement ok
+drop table polygons_tbl
+
+
diff --git a/geom/sql/functions/Tests/ST_AsText.test 
b/geom/sql/functions/Tests/ST_AsText.test
new file mode 100644
--- /dev/null
+++ b/geom/sql/functions/Tests/ST_AsText.test
@@ -0,0 +1,220 @@
+query T rowsort
+select st_astext(st_pointfromtext('point(10 10)'))
+----
+POINT (10 10)
+
+query T rowsort
+select st_astext(st_pointfromtext('point(20 20)', 4326))
+----
+POINT (20 20)
+
+query T rowsort
+select st_astext(st_pointfromtext('point(10 10 10)'))
+----
+POINT Z (10 10 10)
+
+query T rowsort
+select st_astext(st_makepoint(10, 10))
+----
+POINT (10 10)
+
+query T rowsort
+select st_astext(st_point(20, 20))
+----
+POINT (20 20)
+
+query T rowsort
+select st_astext(st_makepoint(10, 10, 10))
+----
+POINT Z (10 10 10)
+
+query T rowsort
+select st_astext(st_linefromtext('linestring(10 10, 20 20, 30 30)'))
+----
+LINESTRING (10 10, 20 20, 30 30)
+
+query T rowsort
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to