From e7a441e798e0a32fc4bb4021e058f3dc080adc80 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sat, 16 Nov 2013 12:07:16 +0100 Subject: Add a test for xml escape/unescape --- src/test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/test.cpp b/src/test.cpp index 7818451..9cb48b7 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -66,6 +66,13 @@ int main() }); xml.feed(doc.data(), doc.size(), true); + /** + * XML escape/escape + */ + const std::string unescaped = "'coucou'/&\"gaga\""; + assert(xml_escape(unescaped) == "'coucou'<cc>/&"gaga""); + assert(xml_unescape(xml_escape(unescaped)) == unescaped); + /** * JID parsing */ -- cgit v1.2.3