comparison 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
comparison
equal deleted inserted replaced
2534:bb5286acfee2 2535:73c8762cee60
31 31
32 SELECT ok( 32 SELECT ok(
33 'DEBON03901G007906548' = isrs_asText(isrs_fromText('DEBON03901G007906548')) 33 'DEBON03901G007906548' = isrs_asText(isrs_fromText('DEBON03901G007906548'))
34 , 34 ,
35 'isrs_asText() is the inverse of isrs_fromText()'); 35 'isrs_asText() is the inverse of isrs_fromText()');
36
37 SELECT throws_ok($$
38 SELECT ISRSrange_points(isrsrange(
39 ('AT', 'XXX', '00001', '00000', 0)::isrs,
40 ('AT', 'XXX', '00001', '00000', 99999)::isrs))
41 $$,
42 'P0002', NULL,
43 'ISRSrange_points fails if not both distance marks can be found');
44
45 SELECT throws_ok($$
46 SELECT ISRSrange_axis(isrsrange(
47 ('AT', 'XXX', '00001', '00000', 0)::isrs,
48 ('AT', 'XXX', '00001', '00000', 2)::isrs),
49 0)
50 $$,
51 'P0002', NULL,
52 'ISRSrange_axis fails if no contiguous axis can be constructed');
36 53
37 SELECT ok( 54 SELECT ok(
38 ISRSrange_area(isrsrange( 55 ISRSrange_area(isrsrange(
39 ('AT', 'XXX', '00001', '00000', 0)::isrs, 56 ('AT', 'XXX', '00001', '00000', 0)::isrs,
40 ('AT', 'XXX', '00001', '00000', 1)::isrs), 57 ('AT', 'XXX', '00001', '00000', 1)::isrs),