view schema/isrs_tests.sql @ 992:a978b2b26a88

Run do and cleanup of import jobs in own go routines with crash handler. This way the import job may die badly w/o killing the job queue, too.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 22 Oct 2018 11:24:25 +0200
parents 61af85a432bf
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');