view schema/isrs_tests.sql @ 578:61af85a432bf

Fix extraction of object reference code Use something more distinguishing in test to make it more likely to catch similar errors.
author Tom Gottfried <tom@intevation.de>
date Thu, 06 Sep 2018 13:19:51 +0200
parents ad07846b09d1
children 6590208e3ee1
line wrap: on
line source

--
-- pgTAP test script for ISRS location code types and functions
--

SELECT results_eq($$
    SELECT isrs_fromText('DEBON03901G007906548')
    $$,
    $$
    SELECT CAST(('DE', 'BON', '03901', 'G0079', 6548) AS isrs)
    $$,
    'Correct ISRS text input gives respective ISRS location code');

SELECT throws_ok($$
    SELECT isrs_fromText('DEUXXX039000000005023')
    $$,
    22023, NULL,
    'ISRS text input needs to have correct length');