From 73aff257cd74adba93a954fce0c5d4cb51ce227c Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 20 May 2014 16:46:02 -0700 Subject: [PATCH] LP#1312945: add regression test This adds a test for the change to the authority.calculate_authority_linking stored function. Signed-off-by: Galen Charlton --- .../src/sql/Pg/t/regress/lp1312945_auth_linking.pg | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/t/regress/lp1312945_auth_linking.pg diff --git a/Open-ILS/src/sql/Pg/t/regress/lp1312945_auth_linking.pg b/Open-ILS/src/sql/Pg/t/regress/lp1312945_auth_linking.pg new file mode 100644 index 0000000000..4ec9b365f9 --- /dev/null +++ b/Open-ILS/src/sql/Pg/t/regress/lp1312945_auth_linking.pg @@ -0,0 +1,59 @@ +BEGIN; + +SELECT plan(1); + +INSERT INTO authority.record_entry (id, marc, last_xact_id) +VALUES (999999100, $$ + 01601cz a2200289n 4500 + + Doe, Jane + + + nnnc + Alias, Annie + 999999101 + + + nnnc + Pen-name, Penny + 999999102 + +$$, 'test'), +(999999101, $$ + 01601cz a2200289n 4500 + + Alias, Annie + + + nnnc + Doe, Jane + 999999100 + +$$, 'test'), +(999999102, $$ + 01601cz a2200289n 4500 + + Pen-name, Penny + + + nnnc + Doe, Jane + 999999100 + +$$, 'test'); + +SELECT is( + ARRAY( + SELECT (authority.calculate_authority_linking(id, 1, marc::XML)).target + FROM authority.record_entry + WHERE id = 999999100 + ORDER BY 1 + ), + ARRAY[ 999999101::BIGINT, 999999102::BIGINT ], + 'retrieve all of the links to other authority records' +); + +ROLLBACK; -- 2.11.0