From 7fec477f235fe5665b75d08244e9dccd1b535c25 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 14 Aug 2015 12:02:54 -0400 Subject: [PATCH] LP#483502 PGTAP test for evergreen.xml_escape(TEXT) Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- Open-ILS/src/sql/Pg/t/xml_escape.pg | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/t/xml_escape.pg diff --git a/Open-ILS/src/sql/Pg/t/xml_escape.pg b/Open-ILS/src/sql/Pg/t/xml_escape.pg new file mode 100644 index 0000000000..5d2c28d5d7 --- /dev/null +++ b/Open-ILS/src/sql/Pg/t/xml_escape.pg @@ -0,0 +1,39 @@ + +BEGIN; + +-- Plan the tests. +SELECT plan(5); + +SELECT is( + evergreen.xml_escape('A Song of Ice & Fire'), + 'A Song of Ice & Fire', + 'XML-Escape ampersand' +); + +SELECT is( + evergreen.xml_escape('A Song of Rice and <<< Fire'), + 'A Song of Rice and <<< Fire', + 'XML-Escape less-than' +); + +SELECT is( + evergreen.xml_escape('>A Song of Mice and >>> Fire'), + '>A Song of Mice and >>> Fire', + 'XML-Escape greater-than' +); + +SELECT is( + evergreen.xml_escape(' Song of Vice &&& <