diff schema/isrs_tests.sql @ 2535:73c8762cee60

Stretch area generation: Throw errors instead of returning NULL It is now an error if not both distance marks for the given stretch can be found or no contiguous axis can be constructed between them.
author Tom Gottfried <tom@intevation.de>
date Thu, 07 Mar 2019 12:20:00 +0100
parents 00cac7890574
children dc4fae4bdb8f
line wrap: on
line diff
--- a/schema/isrs_tests.sql	Thu Mar 07 12:15:14 2019 +0100
+++ b/schema/isrs_tests.sql	Thu Mar 07 12:20:00 2019 +0100
@@ -34,6 +34,23 @@
     ,
     'isrs_asText() is the inverse of isrs_fromText()');
 
+SELECT throws_ok($$
+    SELECT ISRSrange_points(isrsrange(
+            ('AT', 'XXX', '00001', '00000', 0)::isrs,
+            ('AT', 'XXX', '00001', '00000', 99999)::isrs))
+    $$,
+    'P0002', NULL,
+    'ISRSrange_points fails if not both distance marks can be found');
+
+SELECT throws_ok($$
+    SELECT ISRSrange_axis(isrsrange(
+            ('AT', 'XXX', '00001', '00000', 0)::isrs,
+            ('AT', 'XXX', '00001', '00000', 2)::isrs),
+        0)
+    $$,
+    'P0002', NULL,
+    'ISRSrange_axis fails if no contiguous axis can be constructed');
+
 SELECT ok(
     ISRSrange_area(isrsrange(
             ('AT', 'XXX', '00001', '00000', 0)::isrs,