summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'SwifTools/UnitTest/LinkifyTest.cpp')
-rw-r--r--SwifTools/UnitTest/LinkifyTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/SwifTools/UnitTest/LinkifyTest.cpp b/SwifTools/UnitTest/LinkifyTest.cpp
index 6c5fb15..e952585 100644
--- a/SwifTools/UnitTest/LinkifyTest.cpp
+++ b/SwifTools/UnitTest/LinkifyTest.cpp
@@ -46,51 +46,59 @@ class LinkifyTest : public CppUnit::TestFixture {
void testLinkify_URLSurroundedByWhitespace() {
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"),
result);
}
void testLinkify_MultipleURLs() {
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"),
result);
}
void testLinkify_CamelCase() {
String result = Linkify::linkify("http://fOo.cOm/bAz");
CPPUNIT_ASSERT_EQUAL(
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/");
CPPUNIT_ASSERT_EQUAL(
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");
CPPUNIT_ASSERT_EQUAL(
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");
CPPUNIT_ASSERT_EQUAL(
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/");
+
+ CPPUNIT_ASSERT_EQUAL(
+ String("<a href=\"http://foo.com/~kev/\">http://foo.com/~kev/</a>"),
+ result);
+ }
};
CPPUNIT_TEST_SUITE_REGISTRATION(LinkifyTest);