diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-02-14 18:57:18 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-02-14 21:36:32 (GMT) |
commit | cb05f5a908e20006c954ce38755c2e422ecc2388 (patch) | |
tree | a793551a5fe279a57d4330119560e8542f745484 /SwifTools/UnitTest | |
parent | cad974b45c0fb9355e68d9728e42c9ae3dbcebc7 (diff) | |
download | swift-cb05f5a908e20006c954ce38755c2e422ecc2388.zip swift-cb05f5a908e20006c954ce38755c2e422ecc2388.tar.bz2 |
Removed Swift::String.
Diffstat (limited to 'SwifTools/UnitTest')
-rw-r--r-- | SwifTools/UnitTest/LinkifyTest.cpp | 72 | ||||
-rw-r--r-- | SwifTools/UnitTest/TabCompleteTest.cpp | 56 |
2 files changed, 64 insertions, 64 deletions
diff --git a/SwifTools/UnitTest/LinkifyTest.cpp b/SwifTools/UnitTest/LinkifyTest.cpp index a35a686..f7e2a37 100644 --- a/SwifTools/UnitTest/LinkifyTest.cpp +++ b/SwifTools/UnitTest/LinkifyTest.cpp @@ -35,147 +35,147 @@ class LinkifyTest : public CppUnit::TestFixture { public: void testLinkify_URLWithResource() { - String result = Linkify::linkify("http://swift.im/blog"); + std::string result = Linkify::linkify("http://swift.im/blog"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://swift.im/blog\">http://swift.im/blog</a>"), + std::string("<a href=\"http://swift.im/blog\">http://swift.im/blog</a>"), result); } void testLinkify_HTTPSURLWithResource() { - String result = Linkify::linkify("https://swift.im/blog"); + std::string result = Linkify::linkify("https://swift.im/blog"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"https://swift.im/blog\">https://swift.im/blog</a>"), + std::string("<a href=\"https://swift.im/blog\">https://swift.im/blog</a>"), result); } void testLinkify_URLWithEmptyResource() { - String result = Linkify::linkify("http://swift.im/"); + std::string result = Linkify::linkify("http://swift.im/"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://swift.im/\">http://swift.im/</a>"), + std::string("<a href=\"http://swift.im/\">http://swift.im/</a>"), result); } void testLinkify_BareURL() { - String result = Linkify::linkify("http://swift.im"); + std::string result = Linkify::linkify("http://swift.im"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://swift.im\">http://swift.im</a>"), + std::string("<a href=\"http://swift.im\">http://swift.im</a>"), result); } void testLinkify_URLSurroundedByWhitespace() { - String result = Linkify::linkify("Foo http://swift.im/blog Bar"); + std::string result = Linkify::linkify("Foo http://swift.im/blog Bar"); CPPUNIT_ASSERT_EQUAL( - String("Foo <a href=\"http://swift.im/blog\">http://swift.im/blog</a> Bar"), + std::string("Foo <a href=\"http://swift.im/blog\">http://swift.im/blog</a> Bar"), result); } void testLinkify_MultipleURLs() { - String result = Linkify::linkify("Foo http://swift.im/blog Bar http://el-tramo.be/about Baz"); + std::string result = Linkify::linkify("Foo http://swift.im/blog Bar http://el-tramo.be/about Baz"); CPPUNIT_ASSERT_EQUAL( - String("Foo <a href=\"http://swift.im/blog\">http://swift.im/blog</a> Bar <a href=\"http://el-tramo.be/about\">http://el-tramo.be/about</a> Baz"), + std::string("Foo <a href=\"http://swift.im/blog\">http://swift.im/blog</a> Bar <a href=\"http://el-tramo.be/about\">http://el-tramo.be/about</a> Baz"), result); } void testLinkify_CamelCase() { - String result = Linkify::linkify("http://fOo.cOm/bAz"); + std::string result = Linkify::linkify("http://fOo.cOm/bAz"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://fOo.cOm/bAz\">http://fOo.cOm/bAz</a>"), + std::string("<a href=\"http://fOo.cOm/bAz\">http://fOo.cOm/bAz</a>"), result); } void testLinkify_HierarchicalResource() { - String result = Linkify::linkify("http://foo.com/bar/baz/"); + std::string result = Linkify::linkify("http://foo.com/bar/baz/"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://foo.com/bar/baz/\">http://foo.com/bar/baz/</a>"), + std::string("<a href=\"http://foo.com/bar/baz/\">http://foo.com/bar/baz/</a>"), result); } void testLinkify_Anchor() { - String result = Linkify::linkify("http://foo.com/bar#baz"); + std::string result = Linkify::linkify("http://foo.com/bar#baz"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://foo.com/bar#baz\">http://foo.com/bar#baz</a>"), + std::string("<a href=\"http://foo.com/bar#baz\">http://foo.com/bar#baz</a>"), result); } void testLinkify_Plus() { - String result = Linkify::linkify("http://foo.com/bar+baz"); + std::string result = Linkify::linkify("http://foo.com/bar+baz"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://foo.com/bar+baz\">http://foo.com/bar+baz</a>"), + std::string("<a href=\"http://foo.com/bar+baz\">http://foo.com/bar+baz</a>"), result); } void testLinkify_Tilde() { - String result = Linkify::linkify("http://foo.com/~kev/"); + std::string result = Linkify::linkify("http://foo.com/~kev/"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://foo.com/~kev/\">http://foo.com/~kev/</a>"), + std::string("<a href=\"http://foo.com/~kev/\">http://foo.com/~kev/</a>"), result); } void testLinkify_Equal() { - String result = Linkify::linkify("http://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=xmpp+definitive+guide&x=0&y=0"); + std::string result = Linkify::linkify("http://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=xmpp+definitive+guide&x=0&y=0"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=xmpp+definitive+guide&x=0&y=0\">http://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=xmpp+definitive+guide&x=0&y=0</a>"), + std::string("<a href=\"http://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=xmpp+definitive+guide&x=0&y=0\">http://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=xmpp+definitive+guide&x=0&y=0</a>"), result); } void testLinkify_Authentication() { - String result = Linkify::linkify("http://bob:bla@swift.im/foo/bar"); + std::string result = Linkify::linkify("http://bob:bla@swift.im/foo/bar"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://bob:bla@swift.im/foo/bar\">http://bob:bla@swift.im/foo/bar</a>"), + std::string("<a href=\"http://bob:bla@swift.im/foo/bar\">http://bob:bla@swift.im/foo/bar</a>"), result); } void testLinkify_At() { - String result = Linkify::linkify("http://swift.im/foo@bar"); + std::string result = Linkify::linkify("http://swift.im/foo@bar"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://swift.im/foo@bar\">http://swift.im/foo@bar</a>"), + std::string("<a href=\"http://swift.im/foo@bar\">http://swift.im/foo@bar</a>"), result); } void testLinkify_Amps() { - String result = Linkify::linkify("http://swift.im/foo&bar&baz"); + std::string result = Linkify::linkify("http://swift.im/foo&bar&baz"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://swift.im/foo&bar&baz\">http://swift.im/foo&bar&baz</a>"), + std::string("<a href=\"http://swift.im/foo&bar&baz\">http://swift.im/foo&bar&baz</a>"), result); } void testLinkify_UnicodeCharacter() { - String result = Linkify::linkify("http://\xe2\x98\x83.net"); + std::string result = Linkify::linkify("http://\xe2\x98\x83.net"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://\xe2\x98\x83.net\">http://\xe2\x98\x83.net</a>"), + std::string("<a href=\"http://\xe2\x98\x83.net\">http://\xe2\x98\x83.net</a>"), result); } void testLinkify_NewLine() { - String result = Linkify::linkify("http://swift.im\nfoo"); + std::string result = Linkify::linkify("http://swift.im\nfoo"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://swift.im\">http://swift.im</a>\nfoo"), + std::string("<a href=\"http://swift.im\">http://swift.im</a>\nfoo"), result); } void testLinkify_Tab() { - String result = Linkify::linkify("http://swift.im\tfoo"); + std::string result = Linkify::linkify("http://swift.im\tfoo"); CPPUNIT_ASSERT_EQUAL( - String("<a href=\"http://swift.im\">http://swift.im</a>\tfoo"), + std::string("<a href=\"http://swift.im\">http://swift.im</a>\tfoo"), result); } }; diff --git a/SwifTools/UnitTest/TabCompleteTest.cpp b/SwifTools/UnitTest/TabCompleteTest.cpp index b7b643f..2224839 100644 --- a/SwifTools/UnitTest/TabCompleteTest.cpp +++ b/SwifTools/UnitTest/TabCompleteTest.cpp @@ -31,7 +31,7 @@ public: } void testEmpty() { - String blah("Blah"); + std::string blah("Blah"); CPPUNIT_ASSERT_EQUAL( blah, completer_.completeWord(blah)); @@ -42,7 +42,7 @@ public: void testNoMatch() { completer_.addWord("Bleh"); - String blah("Blah"); + std::string blah("Blah"); CPPUNIT_ASSERT_EQUAL( blah, completer_.completeWord(blah)); @@ -52,8 +52,8 @@ public: } void testOneMatch() { - String short1("Bl"); - String long1("Blehling"); + std::string short1("Bl"); + std::string long1("Blehling"); completer_.addWord(long1); CPPUNIT_ASSERT_EQUAL( long1, @@ -64,9 +64,9 @@ public: } void testTwoMatch() { - String short1("Hur"); - String long1("Hurgle"); - String long2("Hurdler"); + std::string short1("Hur"); + std::string long1("Hurgle"); + std::string long2("Hurdler"); completer_.addWord(long1); completer_.addWord("Blah"); completer_.addWord(long2); @@ -83,10 +83,10 @@ public: } void testChangeMatch() { - String short1("Hur"); - String short2("Rub"); - String long1("Hurgle"); - String long2("Rubbish"); + std::string short1("Hur"); + std::string short2("Rub"); + std::string long1("Hurgle"); + std::string long2("Rubbish"); completer_.addWord(long2); completer_.addWord("Blah"); completer_.addWord(long1); @@ -106,9 +106,9 @@ public: } void testRemoveDuringComplete() { - String short1("Kev"); - String long1("Kevin"); - String long2("Kevlar"); + std::string short1("Kev"); + std::string long1("Kevin"); + std::string long2("Kevlar"); completer_.addWord(long1); completer_.addWord("Blah"); completer_.addWord(long2); @@ -126,10 +126,10 @@ public: } void testAddDuringComplete() { - String short1("Rem"); - String long1("Remko"); - String long2("Remove"); - String long3("Remedial"); + std::string short1("Rem"); + std::string long1("Remko"); + std::string long2("Remove"); + std::string long3("Remedial"); completer_.addWord(long1); completer_.addWord("Blah"); completer_.addWord(long2); @@ -147,16 +147,16 @@ public: } void testSwiftRoomSample() { - String t("t"); - String Anpan("Anpan"); - String cdubouloz("cdubouloz"); - String Tobias("Tobias"); - String Zash("Zash"); - String lastsky("lastsky"); - String Steve("Steve Kille"); - String Flo("Flo"); - String Test("Test"); - String test("test"); + std::string t("t"); + std::string Anpan("Anpan"); + std::string cdubouloz("cdubouloz"); + std::string Tobias("Tobias"); + std::string Zash("Zash"); + std::string lastsky("lastsky"); + std::string Steve("Steve Kille"); + std::string Flo("Flo"); + std::string Test("Test"); + std::string test("test"); completer_.addWord(Anpan); completer_.addWord(cdubouloz); completer_.addWord(Tobias); |