From: Bill Erickson Date: Fri, 14 Aug 2015 16:02:54 +0000 (-0400) Subject: LP#483502 PGTAP test for evergreen.xml_escape(TEXT) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Flp1483502-xml-escape-pgtap;p=working%2FEvergreen.git LP#483502 PGTAP test for evergreen.xml_escape(TEXT) Signed-off-by: Bill Erickson --- 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 &&& <