diff options
Diffstat (limited to 'Swiften/Base/UnitTest')
-rw-r--r-- | Swiften/Base/UnitTest/URLTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Swiften/Base/UnitTest/URLTest.cpp b/Swiften/Base/UnitTest/URLTest.cpp index 4de1d33..55c81f6 100644 --- a/Swiften/Base/UnitTest/URLTest.cpp +++ b/Swiften/Base/UnitTest/URLTest.cpp @@ -21,6 +21,8 @@ class URLTest : public CppUnit::TestFixture { CPPUNIT_TEST(testFromString_WithUserInfo); CPPUNIT_TEST(testFromString_NonASCIIHost); CPPUNIT_TEST(testFromString_NonASCIIPath); + CPPUNIT_TEST(testToString); + CPPUNIT_TEST(testToString_WithPort); CPPUNIT_TEST_SUITE_END(); public: @@ -79,6 +81,14 @@ class URLTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(std::string("/baz/tron\xc3\xa7on/bam"), url.getPath()); } + + void testToString() { + CPPUNIT_ASSERT_EQUAL(std::string("http://foo.bar/baz/bam"), URL("http", "foo.bar", "/baz/bam").toString()); + } + + void testToString_WithPort() { + CPPUNIT_ASSERT_EQUAL(std::string("http://foo.bar:1234/baz/bam"), URL("http", "foo.bar", 1234, "/baz/bam").toString()); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(URLTest); |