summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-03-12 18:47:06 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-03-12 18:47:33 (GMT)
commit66ac08ab9a3e323e5257fffebe13aa1ee83f147e (patch)
treef90c99f6a8271934c573f9608faa17894a4b8fd7 /Swiften/Base
parent0f81ad517619854d1918e398d287c89fd7653489 (diff)
downloadswift-contrib-66ac08ab9a3e323e5257fffebe13aa1ee83f147e.zip
swift-contrib-66ac08ab9a3e323e5257fffebe13aa1ee83f147e.tar.bz2
Allow empty hashes in cache.
Diffstat (limited to 'Swiften/Base')
-rw-r--r--Swiften/Base/UnitTest/StringTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Swiften/Base/UnitTest/StringTest.cpp b/Swiften/Base/UnitTest/StringTest.cpp
index 884bbee..b29f331 100644
--- a/Swiften/Base/UnitTest/StringTest.cpp
+++ b/Swiften/Base/UnitTest/StringTest.cpp
@@ -16,6 +16,7 @@ class StringTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(StringTest);
CPPUNIT_TEST(testGetUnicodeCodePoints);
CPPUNIT_TEST(testGetSplittedAtFirst);
+ CPPUNIT_TEST(testGetSplittedAtFirst_CharacterAtBegin);
CPPUNIT_TEST(testGetSplittedAtFirst_CharacterAtEnd);
CPPUNIT_TEST(testGetSplittedAtFirst_NoSuchCharacter);
CPPUNIT_TEST(testReplaceAll);
@@ -44,6 +45,14 @@ class StringTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(std::string("cd@ef"), result.second);
}
+ void testGetSplittedAtFirst_CharacterAtBegin() {
+ std::string testling(" ab");
+
+ std::pair<std::string,std::string> result = String::getSplittedAtFirst(testling, ' ');
+ CPPUNIT_ASSERT(result.first.empty());
+ CPPUNIT_ASSERT_EQUAL(std::string("ab"), result.second);
+ }
+
void testGetSplittedAtFirst_CharacterAtEnd() {
std::string testling("ab@");