summaryrefslogtreecommitdiff
path: root/src/test.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-11-16 12:07:16 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-11-16 12:08:32 +0100
commite7a441e798e0a32fc4bb4021e058f3dc080adc80 (patch)
tree994807dc470bec529c54bd7308f2e91891473999 /src/test.cpp
parenta85e1abaaa5fe4f6cd9da7276088d14bf5f2c41f (diff)
downloadbiboumi-e7a441e798e0a32fc4bb4021e058f3dc080adc80.tar.gz
biboumi-e7a441e798e0a32fc4bb4021e058f3dc080adc80.tar.bz2
biboumi-e7a441e798e0a32fc4bb4021e058f3dc080adc80.tar.xz
biboumi-e7a441e798e0a32fc4bb4021e058f3dc080adc80.zip
Add a test for xml escape/unescape
Diffstat (limited to 'src/test.cpp')
-rw-r--r--src/test.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test.cpp b/src/test.cpp
index 7818451..9cb48b7 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -67,6 +67,13 @@ int main()
xml.feed(doc.data(), doc.size(), true);
/**
+ * XML escape/escape
+ */
+ const std::string unescaped = "'coucou'<cc>/&\"gaga\"";
+ assert(xml_escape(unescaped) == "&apos;coucou&apos;&lt;cc&gt;/&amp;&quot;gaga&quot;");
+ assert(xml_unescape(xml_escape(unescaped)) == unescaped);
+
+ /**
* JID parsing
*/
// Full JID