~singpolyma/biboumi

e7a441e798e0a32fc4bb4021e058f3dc080adc80 — Florent Le Coz 10 years ago a85e1ab
Add a test for xml escape/unescape
1 files changed, 7 insertions(+), 0 deletions(-)

M src/test.cpp
M src/test.cpp => src/test.cpp +7 -0
@@ 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