LP#1470957: provide pgTAP test for expected pubdate normalization
[Evergreen.git] / Open-ILS / src / sql / Pg / t / regress / lp1470957_sort_null_pubdates.sql
1 BEGIN;
2
3 SELECT plan(1);
4
5 INSERT INTO biblio.record_entry (marc, last_xact_id)
6 VALUES (
7     $$<record    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"    xmlns="http://www.loc.gov/MARC21/slim"><leader>00620cam a2200205Ka 4500</leader><controlfield tag="001">1</controlfield><controlfield tag="003">CONS</controlfield><controlfield tag="005">20150113170906.0</controlfield><controlfield tag="008">070101s||||                        eng d</controlfield><datafield tag="245" ind1=" " ind2=" "><subfield code="a">Harry potter</subfield></datafield><datafield tag="901" ind1=" " ind2=" "><subfield code="a">1</subfield><subfield code="b"></subfield><subfield code="c">1</subfield><subfield code="t">biblio</subfield></datafield></record>$$,
8     'LP#1414112'
9 );
10
11 SELECT is(
12     (
13         SELECT COUNT(*) FROM metabib.record_sorter
14         WHERE source = CURRVAL('biblio.record_entry_id_seq')
15         AND attr = 'pubdate'
16     ),
17     0::BIGINT,
18     'LP#1470957: do not provide sorter for |||| pubdate'
19 );
20
21 ROLLBACK;