From ff8d9d1c0fbd83a380ac4cbf4c4898d7e9cd23ea Mon Sep 17 00:00:00 2001 From: Liam Whalen Date: Fri, 14 Aug 2015 13:25:11 -0700 Subject: [PATCH] LP1483509: tests for xml_famous5_to_text Signed-off-by: Liam Whalen Signed-off-by: Galen Charlton --- Open-ILS/src/sql/Pg/t/xml_famous5_to_text.pg | 131 +++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/t/xml_famous5_to_text.pg diff --git a/Open-ILS/src/sql/Pg/t/xml_famous5_to_text.pg b/Open-ILS/src/sql/Pg/t/xml_famous5_to_text.pg new file mode 100644 index 0000000000..825fd6f578 --- /dev/null +++ b/Open-ILS/src/sql/Pg/t/xml_famous5_to_text.pg @@ -0,0 +1,131 @@ +BEGIN; + +SELECT plan(63); + +SELECT is(xml_famous5_to_text('<'), '<', 'less than simple test'); + +SELECT isnt(xml_famous5_to_text('<'), '<', 'less than bad syntax'); + +SELECT is(xml_famous5_to_text('>'), '>', 'greater than simple test'); + +SELECT isnt(xml_famous5_to_text('>'), '>', 'greater than bad syntax'); + +SELECT is(xml_famous5_to_text('''), '''', 'apostrophe simple test'); + +SELECT isnt(xml_famous5_to_text('&apos'), '''', 'apostrohpe bad syntax'); + +SELECT is(xml_famous5_to_text('"'), '"', 'quotation simple test'); + +SELECT isnt(xml_famous5_to_text('"'), '"', 'quotation bad syntax'); + +SELECT is(xml_famous5_to_text('&'), '&', 'ampersand simple test'); + +SELECT isnt(xml_famous5_to_text('&'), '&', 'ampersand bad syntax'); + +SELECT is(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five simple test'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five single syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five two syntax errors'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five three syntax errors'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five four syntax errors'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five five syntax errors'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five less than syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five greater than syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five apostrophe syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five quotation syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five ampersand syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five less than + greater than syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five less than + apostrophe syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five less than + quotation syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five less than + ampersand syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five greater than + apostrophe syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five greater than + quotation syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five greater than + ampersand syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five apostrophe + quotation syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five apostrophe + ampersand syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five quotation + ampersand syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five less than + greater than + apostrophe syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five less than + greater than + quotation syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five less than + greater than + ampersand syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five greater than + apostrophe + quotation syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five greater than + apostrophe + ampersand syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five apostrophe + quotation+ ampersand syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five greater than + apostrophe + quotation + ampersand syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five less than + apostrophe + quotation + ampersand syntax error'); + +SELECT isnt(xml_famous5_to_text('< > ' " &'), '< > '' " &', 'all famous five less than + greater than + quotation + ampersand syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five less than + greater than + apostrophe + quotation syntax error'); + +SELECT isnt(xml_famous5_to_text('< > &apos " &'), '< > '' " &', 'all famous five less than + greater than + apostrophe + quotation syntax error'); + +SELECT is(xml_famous5_to_text('< <'), '< <', 'two less thans simple test'); + +SELECT is(xml_famous5_to_text('> >'), '> >', 'two greater thans simple test'); + +SELECT is(xml_famous5_to_text('' ''), ''' ''', 'two apostrophes simple test'); + +SELECT is(xml_famous5_to_text('" "'), '" "', 'two quotations simple test'); + +SELECT is(xml_famous5_to_text('& &'), '& &', 'two ampersands simple test'); + +SELECT isnt(xml_famous5_to_text('< <'), '< <', 'two less thans one syntax error'); + +SELECT isnt(xml_famous5_to_text('> >'), '> >', 'two greater thans one syntax error'); + +SELECT isnt(xml_famous5_to_text('' &apos'), ''' ''', 'two apostrophes one syntax error'); + +SELECT isnt(xml_famous5_to_text('" "'), '" "', 'two quotations one syntax error'); + +SELECT isnt(xml_famous5_to_text('& &'), '& &', 'two ampersands one syntax error'); + +SELECT is(xml_famous5_to_text('One plus one is < one. Two is > one. A possessive is indicated by '. Quotation marks look like ". Ampersands look like &.'), 'One plus one is < one. Two is > one. A possessive is indicated by ''. Quotation marks look like ". Ampersands look like &.', 'all famous five complex test'); + +SELECT isnt(xml_famous5_to_text('One plus one is < one. Two is > one. A possessive is indicated by '. Quotation marks look like ". Ampersands look like &.'), 'One plus one is < one. Two is > one. A possessive is indicated by ''. Quotation marks look like ". Ampersands look like &.', 'all famous five one syntax errors complex test'); + +SELECT isnt(xml_famous5_to_text('One plus one is < one. Two is > one. A possessive is indicated by '. Quotation marks look like ". Ampersands look like &.'), 'One plus one is < one. Two is > one. A possessive is indicated by ''. Quotation marks look like ". Ampersands look like &.', 'all famous five two syntax errors complex test'); + +SELECT isnt(xml_famous5_to_text('One plus one is < one. Two is > one. A possessive is indicated by &apos. Quotation marks look like ". Ampersands look like &.'), 'One plus one is < one. Two is > one. A possessive is indicated by ''. Quotation marks look like ". Ampersands look like &.', 'all famous five three syntax errors complex test'); + +SELECT isnt(xml_famous5_to_text('One plus one is < one. Two is > one. A possessive is indicated by &apos. Quotation marks look like ". Ampersands look like &.'), 'One plus one is < one. Two is > one. A possessive is indicated by ''. Quotation marks look like ". Ampersands look like &.', 'all famous five four syntax errors complex test'); + +SELECT isnt(xml_famous5_to_text('One plus one is < one. Two is > one. A possessive is indicated by &apos. Quotation marks look like ". Ampersands look like &.'), 'One plus one is < one. Two is > one. A possessive is indicated by ''. Quotation marks look like ". Ampersands look like &.', 'all famous five five syntax errors complex test'); + +SELECT isnt(xml_famous5_to_text('One plus one is < one. Two is > one. A possessive is indicated by '. Quotation marks look like ". Ampersands look like &.'), 'One plus one is < one. Two is > one. A possessive is indicated by ''. Quotation marks look like ". Ampersands look like &.', 'less than syntax errors complex test'); + +SELECT isnt(xml_famous5_to_text('One plus one is < one. Two is > one. A possessive is indicated by '. Quotation marks look like ". Ampersands look like &.'), 'One plus one is < one. Two is > one. A possessive is indicated by ''. Quotation marks look like ". Ampersands look like &.', 'greater than syntax errors complex test'); + +SELECT isnt(xml_famous5_to_text('One plus one is < one. Two is > one. A possessive is indicated by &apos. Quotation marks look like ". Ampersands look like &.'), 'One plus one is < one. Two is > one. A possessive is indicated by ''. Quotation marks look like ". Ampersands look like &.', 'apostrophe syntax errors complex test'); + +SELECT isnt(xml_famous5_to_text('One plus one is < one. Two is > one. A possessive is indicated by '. Quotation marks look like ". Ampersands look like &.'), 'One plus one is < one. Two is > one. A possessive is indicated by ''. Quotation marks look like ". Ampersands look like &.', 'quotation syntax errors complex test'); + +SELECT isnt(xml_famous5_to_text('One plus one is < one. Two is > one. A possessive is indicated by '. Quotation marks look like ". Ampersands look like &.'), 'One plus one is < one. Two is > one. A possessive is indicated by ''. Quotation marks look like ". Ampersands look like &.', 'ampersand syntax errors complex test'); + +ROLLBACK; -- 2.11.0