diff options
Diffstat (limited to 'SwifTools/UnitTest/LinkifyTest.cpp')
| -rw-r--r-- | SwifTools/UnitTest/LinkifyTest.cpp | 9 |
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 @@ -11,12 +11,13 @@ class LinkifyTest : public CppUnit::TestFixture { CPPUNIT_TEST(testLinkify_URLWithEmptyResource); CPPUNIT_TEST(testLinkify_BareURL); CPPUNIT_TEST(testLinkify_URLSurroundedByWhitespace); CPPUNIT_TEST(testLinkify_MultipleURLs); CPPUNIT_TEST(testLinkify_CamelCase); CPPUNIT_TEST(testLinkify_HierarchicalResource); + CPPUNIT_TEST(testLinkify_Anchor); CPPUNIT_TEST_SUITE_END(); public: void testLinkify_URLWithResource() { String result = Linkify::linkify("http://swift.im/blog"); @@ -70,9 +71,17 @@ class LinkifyTest : public CppUnit::TestFixture { 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); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(LinkifyTest); |
Swift