From: Sandro Santilli Date: Wed, 18 Feb 2015 17:20:23 +0000 (+0000) Subject: Extract operators tests from the generic, legacy "regress" test X-Git-Tag: 2.2.0rc1~663 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a38ded71fc19a8e48d55943daad53d37cc7a9c2;p=postgis Extract operators tests from the generic, legacy "regress" test git-svn-id: http://svn.osgeo.org/postgis/trunk@13235 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/regress/Makefile.in b/regress/Makefile.in index 34d0d8b6c..ed8161d33 100644 --- a/regress/Makefile.in +++ b/regress/Makefile.in @@ -74,6 +74,7 @@ TESTS = \ dumper/literalsrid \ dumper/realtable \ binary \ + operators \ regress \ regress_index \ regress_index_nulls \ diff --git a/regress/operators.sql b/regress/operators.sql new file mode 100644 index 000000000..38cf2341c --- /dev/null +++ b/regress/operators.sql @@ -0,0 +1,49 @@ +--- operator testing (testing is on the BOUNDING BOX (2d), not the actual geometries) + +select '77','POINT(1 1)'::GEOMETRY &< 'POINT(1 1)'::GEOMETRY as bool; +select '78','POINT(1 1)'::GEOMETRY &< 'POINT(2 1)'::GEOMETRY as bool; +select '79','POINT(2 1)'::GEOMETRY &< 'POINT(1 1)'::GEOMETRY as bool; + +select '80','POINT(1 1)'::GEOMETRY << 'POINT(1 1)'::GEOMETRY as bool; +select '81','POINT(1 1)'::GEOMETRY << 'POINT(2 1)'::GEOMETRY as bool; +select '82','POINT(2 1)'::GEOMETRY << 'POINT(1 1)'::GEOMETRY as bool; + + +select '83','POINT(1 1)'::GEOMETRY &> 'POINT(1 1)'::GEOMETRY as bool; +select '84','POINT(1 1)'::GEOMETRY &> 'POINT(2 1)'::GEOMETRY as bool; +select '85','POINT(2 1)'::GEOMETRY &> 'POINT(1 1)'::GEOMETRY as bool; + +select '86','POINT(1 1)'::GEOMETRY >> 'POINT(1 1)'::GEOMETRY as bool; +select '87','POINT(1 1)'::GEOMETRY >> 'POINT(2 1)'::GEOMETRY as bool; +select '88','POINT(2 1)'::GEOMETRY >> 'POINT(1 1)'::GEOMETRY as bool; + +-- overlap + +select '89','POINT(1 1)'::GEOMETRY && 'POINT(1 1)'::GEOMETRY as bool; +select '90','POINT(1 1)'::GEOMETRY && 'POINT(2 2)'::GEOMETRY as bool; +select '91','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(1 1, 2 2)'::GEOMETRY as bool; +select '92','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(1.0001 1, 2 2)'::GEOMETRY as bool; +select '93','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(1 1.0001, 2 2)'::GEOMETRY as bool; +select '94','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(1 0, 2 2)'::GEOMETRY as bool; +select '95','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(1.0001 0, 2 2)'::GEOMETRY as bool; + +select '96','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(0 1, 1 2)'::GEOMETRY as bool; +select '97','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(0 1.0001, 1 2)'::GEOMETRY as bool; + +--- contains + +select '98','MULTIPOINT(0 0, 10 10)'::GEOMETRY ~ 'MULTIPOINT(5 5, 7 7)'::GEOMETRY as bool; +select '99','MULTIPOINT(5 5, 7 7)'::GEOMETRY ~ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; +select '100','MULTIPOINT(0 0, 7 7)'::GEOMETRY ~ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; +select '101','MULTIPOINT(-0.0001 0, 7 7)'::GEOMETRY ~ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; + +--- contained by + +select '102','MULTIPOINT(0 0, 10 10)'::GEOMETRY @ 'MULTIPOINT(5 5, 7 7)'::GEOMETRY as bool; +select '103','MULTIPOINT(5 5, 7 7)'::GEOMETRY @ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; +select '104','MULTIPOINT(0 0, 7 7)'::GEOMETRY @ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; +select '105','MULTIPOINT(-0.0001 0, 7 7)'::GEOMETRY @ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; + + + + diff --git a/regress/operators_expected b/regress/operators_expected new file mode 100644 index 000000000..c691bdd6b --- /dev/null +++ b/regress/operators_expected @@ -0,0 +1,29 @@ +77|t +78|t +79|f +80|f +81|t +82|f +83|t +84|f +85|t +86|f +87|f +88|t +89|t +90|f +91|t +92|f +93|f +94|t +95|f +96|t +97|f +98|t +99|f +100|f +101|f +102|f +103|t +104|t +105|f diff --git a/regress/regress.sql b/regress/regress.sql index 43dbceec3..8395dce64 100644 --- a/regress/regress.sql +++ b/regress/regress.sql @@ -123,54 +123,6 @@ select '75a',ST_OrderingEquals('LINESTRING(1 1, 2 2)'::GEOMETRY,'LINESTRING(2 2, select '76','LINESTRING(1 1, 2 2)'::GEOMETRY ~= 'LINESTRING(1 1, 2 2, 3 3)'::GEOMETRY as bool; select '76a',ST_OrderingEquals('LINESTRING(1 1, 2 2)'::GEOMETRY,'LINESTRING(1 1, 2 2, 3 3)'::GEOMETRY) as bool; ---- operator testing (testing is on the BOUNDING BOX (2d), not the actual geometries) - -select '77','POINT(1 1)'::GEOMETRY &< 'POINT(1 1)'::GEOMETRY as bool; -select '78','POINT(1 1)'::GEOMETRY &< 'POINT(2 1)'::GEOMETRY as bool; -select '79','POINT(2 1)'::GEOMETRY &< 'POINT(1 1)'::GEOMETRY as bool; - -select '80','POINT(1 1)'::GEOMETRY << 'POINT(1 1)'::GEOMETRY as bool; -select '81','POINT(1 1)'::GEOMETRY << 'POINT(2 1)'::GEOMETRY as bool; -select '82','POINT(2 1)'::GEOMETRY << 'POINT(1 1)'::GEOMETRY as bool; - - -select '83','POINT(1 1)'::GEOMETRY &> 'POINT(1 1)'::GEOMETRY as bool; -select '84','POINT(1 1)'::GEOMETRY &> 'POINT(2 1)'::GEOMETRY as bool; -select '85','POINT(2 1)'::GEOMETRY &> 'POINT(1 1)'::GEOMETRY as bool; - -select '86','POINT(1 1)'::GEOMETRY >> 'POINT(1 1)'::GEOMETRY as bool; -select '87','POINT(1 1)'::GEOMETRY >> 'POINT(2 1)'::GEOMETRY as bool; -select '88','POINT(2 1)'::GEOMETRY >> 'POINT(1 1)'::GEOMETRY as bool; - --- overlap - -select '89','POINT(1 1)'::GEOMETRY && 'POINT(1 1)'::GEOMETRY as bool; -select '90','POINT(1 1)'::GEOMETRY && 'POINT(2 2)'::GEOMETRY as bool; -select '91','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(1 1, 2 2)'::GEOMETRY as bool; -select '92','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(1.0001 1, 2 2)'::GEOMETRY as bool; -select '93','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(1 1.0001, 2 2)'::GEOMETRY as bool; -select '94','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(1 0, 2 2)'::GEOMETRY as bool; -select '95','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(1.0001 0, 2 2)'::GEOMETRY as bool; - -select '96','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(0 1, 1 2)'::GEOMETRY as bool; -select '97','MULTIPOINT(0 0, 1 1)'::GEOMETRY && 'MULTIPOINT(0 1.0001, 1 2)'::GEOMETRY as bool; - ---- contains - -select '98','MULTIPOINT(0 0, 10 10)'::GEOMETRY ~ 'MULTIPOINT(5 5, 7 7)'::GEOMETRY as bool; -select '99','MULTIPOINT(5 5, 7 7)'::GEOMETRY ~ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; -select '100','MULTIPOINT(0 0, 7 7)'::GEOMETRY ~ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; -select '101','MULTIPOINT(-0.0001 0, 7 7)'::GEOMETRY ~ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; - ---- contained by - -select '102','MULTIPOINT(0 0, 10 10)'::GEOMETRY @ 'MULTIPOINT(5 5, 7 7)'::GEOMETRY as bool; -select '103','MULTIPOINT(5 5, 7 7)'::GEOMETRY @ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; -select '104','MULTIPOINT(0 0, 7 7)'::GEOMETRY @ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; -select '105','MULTIPOINT(-0.0001 0, 7 7)'::GEOMETRY @ 'MULTIPOINT(0 0, 10 10)'::GEOMETRY as bool; - - - --- function testing --- conversion function diff --git a/regress/regress_expected b/regress/regress_expected index c8e075522..41672fb6b 100644 --- a/regress/regress_expected +++ b/regress/regress_expected @@ -86,35 +86,6 @@ ERROR: parse error - invalid geometry at character 23 75a|f 76|f 76a|f -77|t -78|t -79|f -80|f -81|t -82|f -83|t -84|f -85|t -86|f -87|f -88|t -89|t -90|f -91|t -92|f -93|f -94|t -95|f -96|t -97|f -98|t -99|f -100|f -101|f -102|f -103|t -104|t -105|f 106|BOX3D(0 0 0,7 7 0) 107|POLYGON((0 0,0 7,7 7,7 0,0 0)) 108|2