Live pgTAP test for 0847, authority overlay generator fixes
authorMike Rylander <mrylander@gmail.com>
Tue, 5 Nov 2013 17:31:17 +0000 (12:31 -0500)
committerMike Rylander <mrylander@gmail.com>
Tue, 5 Nov 2013 18:39:01 +0000 (13:39 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/live_t/0847.auth_overlay_generator.pg [new file with mode: 0644]

diff --git a/Open-ILS/src/sql/Pg/live_t/0847.auth_overlay_generator.pg b/Open-ILS/src/sql/Pg/live_t/0847.auth_overlay_generator.pg
new file mode 100644 (file)
index 0000000..2a4c88b
--- /dev/null
@@ -0,0 +1,29 @@
+\set ECHO
+\set QUIET 1
+-- Turn off echo and keep things quiet.
+
+-- Format the output for nice TAP.
+\pset format unaligned
+\pset tuples_only true
+\pset pager
+
+-- Revert all changes on failure.
+\set ON_ERROR_ROLLBACK 1
+\set ON_ERROR_STOP true
+\set QUIET 1
+
+-- let's do this thing
+BEGIN;
+
+SELECT plan(1);
+
+SELECT is(
+    $$<record xmlns="http://www.loc.gov/MARC21/slim"><leader>00881nam a2200193   4500</leader><datafield tag="600" ind1="1" ind2=" "><subfield code="a">Girdlestone, Cuthbert Morton,</subfield><subfield code="d">1895-1975</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Girdlestone, Cuthbert Morton,</subfield><subfield code="d">1895-1975</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Girdlestone, Cuthbert Morton,</subfield><subfield code="d">1895-1975</subfield></datafield><datafield tag="800" ind1="1" ind2=" "><subfield code="a">Girdlestone, Cuthbert Morton,</subfield><subfield code="d">1895-1975</subfield></datafield><datafield tag="905" ind1=" " ind2=" "><subfield code="r">600abcdefklmnopqrstvxyz[0~\)1$],100abcdefklmnopqrstvxyz[0~\)1$],700abcdefklmnopqrstvxyz[0~\)1$],800abcdefklmnopqrstvxyz[0~\)1$]</subfield></datafield></record>$$,
+    (select authority.generate_overlay_template(marc) from authority.record_entry where id = 1),
+    'authority.generate_overlay_template includes indicators and excludes junk tags'
+);
+
+
+SELECT * FROM finish();
+ROLLBACK;
+