X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c1a7bc4835c3a2cb7fc2e6bbdef2d5eee4f6d3c..ef1991645ae0a3524c6cc11b1224ee07c9ba54ee:/tests/uris/uris.cpp?ds=inline diff --git a/tests/uris/uris.cpp b/tests/uris/uris.cpp index ec59baf1ed..1d05f04541 100644 --- a/tests/uris/uris.cpp +++ b/tests/uris/uris.cpp @@ -49,6 +49,7 @@ private: CPPUNIT_TEST( Assignment ); CPPUNIT_TEST( Comparison ); CPPUNIT_TEST( Unescaping ); + CPPUNIT_TEST( FileScheme ); #if TEST_URL CPPUNIT_TEST( URLCompat ); #if wxUSE_PROTOCOL_HTTP @@ -68,6 +69,7 @@ private: void Assignment(); void Comparison(); void Unescaping(); + void FileScheme(); #if TEST_URL void URLCompat(); @@ -299,6 +301,26 @@ void URITestCase::Unescaping() CPPUNIT_ASSERT(works2.IsSameAs(broken2)); } + +void URITestCase::FileScheme() +{ + //file:// variety (NOT CONFORMANT TO THE RFC) + CPPUNIT_ASSERT(wxURI(wxString(wxT("file://e:/wxcode/script1.xml"))).GetPath() + == wxT("e:/wxcode/script1.xml") ); + + //file:/// variety + CPPUNIT_ASSERT(wxURI(wxString(wxT("file:///e:/wxcode/script1.xml"))).GetPath() + == wxT("/e:/wxcode/script1.xml") ); + + //file:/ variety + CPPUNIT_ASSERT(wxURI(wxString(wxT("file:/e:/wxcode/script1.xml"))).GetPath() + == wxT("/e:/wxcode/script1.xml") ); + + //file: variety + CPPUNIT_ASSERT(wxURI(wxString(wxT("file:e:/wxcode/script1.xml"))).GetPath() + == wxT("e:/wxcode/script1.xml") ); +} + #if TEST_URL const wxChar* pszProblemUrls[] = { wxT("http://www.csdn.net"),