summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-11-18 20:49:42 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-11-18 20:49:42 (GMT)
commitb6594d2bdd57bf786fcc62a35f8e837ba8d221cc (patch)
tree830a0900d3dbfd8a7eaf8239ca6243b7ff9f1be5 /SwifTools/UnitTest
parent013725b6ac01ee0351cd61701588099dc1ec1258 (diff)
downloadswift-contrib-b6594d2bdd57bf786fcc62a35f8e837ba8d221cc.zip
swift-contrib-b6594d2bdd57bf786fcc62a35f8e837ba8d221cc.tar.bz2
Fix linkifying of urls with #.
Diffstat (limited to 'SwifTools/UnitTest')
-rw-r--r--SwifTools/UnitTest/LinkifyTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/SwifTools/UnitTest/LinkifyTest.cpp b/SwifTools/UnitTest/LinkifyTest.cpp
index b55067c..b31bbfe 100644
--- a/SwifTools/UnitTest/LinkifyTest.cpp
+++ b/SwifTools/UnitTest/LinkifyTest.cpp
@@ -14,6 +14,7 @@ class LinkifyTest : public CppUnit::TestFixture {
CPPUNIT_TEST(testLinkify_MultipleURLs);
CPPUNIT_TEST(testLinkify_CamelCase);
CPPUNIT_TEST(testLinkify_HierarchicalResource);
+ CPPUNIT_TEST(testLinkify_Anchor);
CPPUNIT_TEST_SUITE_END();
public:
@@ -73,6 +74,14 @@ class LinkifyTest : public CppUnit::TestFixture {
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);
+ }
};
CPPUNIT_TEST_SUITE_REGISTRATION(LinkifyTest);