URL conditional and consistent intendation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -22,11 +22,12 @@
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/uri.h"
|
||||
#include "wx/url.h"
|
||||
|
||||
#include "wx/cppunit.h"
|
||||
|
||||
// Test wxURL & wxURI compat?
|
||||
#define TEST_URL 1
|
||||
#define TEST_URL ( 1 && wxUSE_URL )
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// test class
|
||||
@@ -181,29 +182,29 @@ void URITestCase::NormalResolving()
|
||||
wxURI* uri;
|
||||
|
||||
URI_TEST("g:h" ,"g:h")
|
||||
URI_TEST("g" ,"http://a/b/c/g")
|
||||
URI_TEST("./g" ,"http://a/b/c/g")
|
||||
URI_TEST("g/" ,"http://a/b/c/g/")
|
||||
URI_TEST("/g" ,"http://a/g")
|
||||
URI_TEST("//g" ,"http://g")
|
||||
URI_TEST("?y" ,"http://a/b/c/d;p?y")
|
||||
URI_TEST("g" ,"http://a/b/c/g")
|
||||
URI_TEST("./g" ,"http://a/b/c/g")
|
||||
URI_TEST("g/" ,"http://a/b/c/g/")
|
||||
URI_TEST("/g" ,"http://a/g")
|
||||
URI_TEST("//g" ,"http://g")
|
||||
URI_TEST("?y" ,"http://a/b/c/d;p?y")
|
||||
URI_TEST("g?y" ,"http://a/b/c/g?y")
|
||||
URI_TEST("#s" ,"http://a/b/c/d;p?q#s")
|
||||
URI_TEST("g#s" ,"http://a/b/c/g#s")
|
||||
URI_TEST("g?y#s","http://a/b/c/g?y#s")
|
||||
URI_TEST(";x" ,"http://a/b/c/;x")
|
||||
URI_TEST("g;x" ,"http://a/b/c/g;x")
|
||||
URI_TEST("g;x?y#s","http://a/b/c/g;x?y#s")
|
||||
URI_TEST("#s" ,"http://a/b/c/d;p?q#s")
|
||||
URI_TEST("g#s" ,"http://a/b/c/g#s")
|
||||
URI_TEST("g?y#s","http://a/b/c/g?y#s")
|
||||
URI_TEST(";x" ,"http://a/b/c/;x")
|
||||
URI_TEST("g;x" ,"http://a/b/c/g;x")
|
||||
URI_TEST("g;x?y#s","http://a/b/c/g;x?y#s")
|
||||
|
||||
URI_TEST("" ,"http://a/b/c/d;p?q")
|
||||
URI_TEST("." ,"http://a/b/c/")
|
||||
URI_TEST("./" ,"http://a/b/c/")
|
||||
URI_TEST(".." ,"http://a/b/")
|
||||
URI_TEST("../" ,"http://a/b/")
|
||||
URI_TEST("../g" ,"http://a/b/g")
|
||||
URI_TEST("../..","http://a/")
|
||||
URI_TEST("../../" , "http://a/")
|
||||
URI_TEST("../../g" , "http://a/g")
|
||||
URI_TEST("" ,"http://a/b/c/d;p?q")
|
||||
URI_TEST("." ,"http://a/b/c/")
|
||||
URI_TEST("./" ,"http://a/b/c/")
|
||||
URI_TEST(".." ,"http://a/b/")
|
||||
URI_TEST("../" ,"http://a/b/")
|
||||
URI_TEST("../g" ,"http://a/b/g")
|
||||
URI_TEST("../..","http://a/")
|
||||
URI_TEST("../../" , "http://a/")
|
||||
URI_TEST("../../g" , "http://a/g")
|
||||
}
|
||||
|
||||
void URITestCase::ComplexResolving()
|
||||
@@ -212,12 +213,12 @@ void URITestCase::ComplexResolving()
|
||||
wxURI* uri;
|
||||
|
||||
//odd path examples
|
||||
URI_TEST("/./g" ,"http://a/g")
|
||||
URI_TEST("/../g" ,"http://a/g")
|
||||
URI_TEST("g." ,"http://a/b/c/g.")
|
||||
URI_TEST(".g" ,"http://a/b/c/.g")
|
||||
URI_TEST("g.." ,"http://a/b/c/g..")
|
||||
URI_TEST("..g" ,"http://a/b/c/..g")
|
||||
URI_TEST("/./g" ,"http://a/g")
|
||||
URI_TEST("/../g" ,"http://a/g")
|
||||
URI_TEST("g." ,"http://a/b/c/g.")
|
||||
URI_TEST(".g" ,"http://a/b/c/.g")
|
||||
URI_TEST("g.." ,"http://a/b/c/g..")
|
||||
URI_TEST("..g" ,"http://a/b/c/..g")
|
||||
}
|
||||
//Should Fail
|
||||
//"../../../g" = "http://a/g"
|
||||
@@ -229,12 +230,12 @@ void URITestCase::ReallyComplexResolving()
|
||||
wxURI* uri;
|
||||
|
||||
//even more odder path examples
|
||||
URI_TEST("./../g" ,"http://a/b/g")
|
||||
URI_TEST("./g/." ,"http://a/b/c/g/")
|
||||
URI_TEST("g/./h" ,"http://a/b/c/g/h")
|
||||
URI_TEST("g/../h" ,"http://a/b/c/h")
|
||||
URI_TEST("g;x=1/./y" , "http://a/b/c/g;x=1/y")
|
||||
URI_TEST("g;x=1/../y" , "http://a/b/c/y")
|
||||
URI_TEST("./../g" ,"http://a/b/g")
|
||||
URI_TEST("./g/." ,"http://a/b/c/g/")
|
||||
URI_TEST("g/./h" ,"http://a/b/c/g/h")
|
||||
URI_TEST("g/../h" ,"http://a/b/c/h")
|
||||
URI_TEST("g;x=1/./y" , "http://a/b/c/g;x=1/y")
|
||||
URI_TEST("g;x=1/../y" , "http://a/b/c/y")
|
||||
}
|
||||
|
||||
void URITestCase::QueryFragmentResolving()
|
||||
@@ -242,11 +243,11 @@ void URITestCase::QueryFragmentResolving()
|
||||
wxURI masteruri(wxT("http://a/b/c/d;p?q"));
|
||||
wxURI* uri;
|
||||
|
||||
//query/fragment ambigiousness
|
||||
URI_TEST("g?y/./x","http://a/b/c/g?y/./x")
|
||||
URI_TEST("g?y/../x" , "http://a/b/c/g?y/../x")
|
||||
URI_TEST("g#s/./x","http://a/b/c/g#s/./x")
|
||||
URI_TEST("g#s/../x" , "http://a/b/c/g#s/../x")
|
||||
//query/fragment ambigiousness
|
||||
URI_TEST("g?y/./x","http://a/b/c/g?y/./x")
|
||||
URI_TEST("g?y/../x" , "http://a/b/c/g?y/../x")
|
||||
URI_TEST("g#s/./x","http://a/b/c/g#s/./x")
|
||||
URI_TEST("g#s/../x" , "http://a/b/c/g#s/../x")
|
||||
}
|
||||
|
||||
void URITestCase::BackwardsResolving()
|
||||
@@ -254,10 +255,10 @@ void URITestCase::BackwardsResolving()
|
||||
wxURI masteruri(wxT("http://a/b/c/d;p?q"));
|
||||
wxURI* uri;
|
||||
|
||||
//"NEW"
|
||||
URI_TEST("http:g" , "http:g") //strict
|
||||
//bw compat
|
||||
URI_TEST_RESOLVE("http:g", "http://a/b/c/g", false);
|
||||
//"NEW"
|
||||
URI_TEST("http:g" , "http:g") //strict
|
||||
//bw compat
|
||||
URI_TEST_RESOLVE("http:g", "http://a/b/c/g", false);
|
||||
}
|
||||
|
||||
void URITestCase::Assignment()
|
||||
|
Reference in New Issue
Block a user