X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FTest%2FSystem%2FUriTest3.cs;h=da4e7c4d5503344a62c467c9947dafc8f5882368;hb=8bb9b4409d3f73fdf5ec2afc3b9add6bd33f712f;hp=4667dff48c65dcf978987d360e8d6bac47c36cac;hpb=c7492fcbdb926c8e5cbae2d12be395aa2357369a;p=mono.git diff --git a/mcs/class/System/Test/System/UriTest3.cs b/mcs/class/System/Test/System/UriTest3.cs index 4667dff48c6..da4e7c4d550 100644 --- a/mcs/class/System/Test/System/UriTest3.cs +++ b/mcs/class/System/Test/System/UriTest3.cs @@ -439,6 +439,9 @@ namespace MonoTests.System Uri uri11 = new Uri ("mailto:xxx@xxx.com?subject=hola"); Uri uri12 = new Uri ("mailto:xxx@mail.xxx.com?subject=hola"); Uri uri13 = new Uri ("mailto:xxx@xxx.com/foo/bar"); + Uri uri14 = new Uri ("http://www.contoso.com/test1/"); + Uri uri15 = new Uri ("http://www.contoso.com/"); + Uri uri16 = new Uri ("http://www.contoso.com/test"); AssertRelativeUri ("foo/bar/index.htm#fragment", uri1, uri2, "#A"); AssertRelativeUri ("../../index.htm?x=2", uri2, uri1, "#B"); @@ -470,6 +473,61 @@ namespace MonoTests.System Assert.IsTrue (relativeUri.IsAbsoluteUri, "#N1"); Assert.AreEqual (uri5.ToString (), relativeUri.ToString (), "#N2"); Assert.AreEqual (uri5.OriginalString, relativeUri.OriginalString, "#N3"); + + AssertRelativeUri ("../", uri14, uri15, "#O"); + AssertRelativeUri ("./", uri16, uri15, "#P"); + + Uri a1 = new Uri ("http://something/something2/test/"); + Uri a2 = new Uri ("http://something/something2/"); + Uri a3 = new Uri ("http://something/something2/test"); + Uri a4 = new Uri ("http://something/something2"); + + AssertRelativeUri ("../", a1, a2, "Q1"); + AssertRelativeUri ("../../something2", a1, a4, "Q2"); + AssertRelativeUri ("./", a3, a2, "Q3"); + AssertRelativeUri ("../something2", a3, a4, "Q4"); + + Uri b1 = new Uri ("http://something/test/"); + Uri b2 = new Uri ("http://something/"); + Uri b3 = new Uri ("http://something/test"); + Uri b4 = new Uri ("http://something"); + + AssertRelativeUri ("../", b1, b2, "R1"); + AssertRelativeUri ("../", b1, b4, "R2"); + AssertRelativeUri ("./", b3, b2, "R3"); + AssertRelativeUri ("./", b3, b4, "R4"); + + Uri c1 = new Uri ("C:\\something\\something2\\test\\"); + Uri c2 = new Uri ("C:\\something\\something2\\"); + Uri c3 = new Uri ("C:\\something\\something2\\test"); + Uri c4 = new Uri ("C:\\something\\something2"); + + AssertRelativeUri ("../", c1, c2, "S1"); + AssertRelativeUri ("../../something2", c1, c4, "S2"); + AssertRelativeUri ("./", c3, c2, "S3"); + AssertRelativeUri ("../something2", c3, c4, "S4"); + + Uri d1 = new Uri ("C:\\something\\test\\"); + Uri d2 = new Uri ("C:\\something\\"); + Uri d3 = new Uri ("C:\\something\\test"); + Uri d4 = new Uri ("C:\\something"); + + AssertRelativeUri ("../", d1, d2, "T1"); + AssertRelativeUri ("../../something", d1, d4, "T2"); + AssertRelativeUri ("./", d3, d2, "T3"); + AssertRelativeUri ("../something", d3, d4, "T4"); + + Uri e1 = new Uri ("C:\\something\\"); + Uri e2 = new Uri ("C:\\"); + Uri e3 = new Uri ("C:\\something"); + + AssertRelativeUri ("../", e1, e2, "U1"); + AssertRelativeUri ("./", e3, e2, "U2"); + AssertRelativeUri ("", e1, e1, "U3"); + AssertRelativeUri ("", e3, e3, "U4"); + AssertRelativeUri ("../something", e1, e3, "U5"); + AssertRelativeUri ("something/", e3, e1, "U6"); + AssertRelativeUri ("something", e2, e3, "U7"); } [Test]