summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-05-22 08:17:09 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-05-22 08:17:09 (GMT)
commit7136ec8cee4e60c1923db8bf6ccb62c43d779497 (patch)
tree77bd402e6be8438317db01cd05c59ccc03ba922c /Swiften/JID/UnitTest
parentdcda69b902744154d1e4ed67c89bde8bb6fdfcb9 (diff)
downloadswift-7136ec8cee4e60c1923db8bf6ccb62c43d779497.zip
swift-7136ec8cee4e60c1923db8bf6ccb62c43d779497.tar.bz2
Fixed bug in JID escaping.
Diffstat (limited to 'Swiften/JID/UnitTest')
-rw-r--r--Swiften/JID/UnitTest/JIDTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/JID/UnitTest/JIDTest.cpp b/Swiften/JID/UnitTest/JIDTest.cpp
index 6b5409f..6f7895a 100644
--- a/Swiften/JID/UnitTest/JIDTest.cpp
+++ b/Swiften/JID/UnitTest/JIDTest.cpp
@@ -53,6 +53,7 @@ class JIDTest : public CppUnit::TestFixture
CPPUNIT_TEST(testHasResource_NoResource);
CPPUNIT_TEST(testGetEscapedNode);
CPPUNIT_TEST(testGetEscapedNode_XEP106Examples);
+ CPPUNIT_TEST(testGetEscapedNode_BackslashAtEnd);
CPPUNIT_TEST(testGetUnescapedNode);
CPPUNIT_TEST(testGetUnescapedNode_XEP106Examples);
CPPUNIT_TEST_SUITE_END();
@@ -342,6 +343,10 @@ class JIDTest : public CppUnit::TestFixture
CPPUNIT_ASSERT_EQUAL(JID::getEscapedNode("c:\\5commas"), std::string("c\\3a\\5c5commas"));
}
+ void testGetEscapedNode_BackslashAtEnd() {
+ CPPUNIT_ASSERT_EQUAL(std::string("foo\\"), JID::getEscapedNode("foo\\"));
+ }
+
void testGetUnescapedNode() {
std::string input = "\\& \" ' / <\\\\> @ : \\5c\\40";
JID testling(JID::getEscapedNode(input) + "@y");