2004-01-06 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Tue, 6 Jan 2004 03:15:21 +0000 (03:15 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Tue, 6 Jan 2004 03:15:21 +0000 (03:15 -0000)
* UriTest.cs :
  Derived from Assertion.
  Added ConstructorsRejectRelativePath ().
  "file://cygwin" means machine name cygwin, not top directory cygwin.
* UriTest2.cs : added relative constructor tests and manually created
  absolute uri tests (rejected by MS.NET).
* uri-test-generator.cs : added relative test generator.
* added test-uri-props-manual.txt, test-uri-relative-list.txt,
  test-uri-relative-props.txt for relative path test and
  manually added tests.

svn path=/trunk/mcs/; revision=21731

mcs/class/System/Test/System/ChangeLog
mcs/class/System/Test/System/UriTest.cs
mcs/class/System/Test/System/UriTest2.cs
mcs/class/System/Test/System/test-uri-props-manual.txt [new file with mode: 0755]
mcs/class/System/Test/System/test-uri-relative-list.txt [new file with mode: 0755]
mcs/class/System/Test/System/test-uri-relative-props.txt [new file with mode: 0755]
mcs/class/System/Test/System/uri-test-generator.cs

index 6d3a1e018dad4bd0bf128d50461ffb3b31919e86..918780d127c2415eeb08cc2a641e82999549a5f8 100644 (file)
@@ -1,3 +1,16 @@
+2004-01-06  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * UriTest.cs :
+         Derived from Assertion.
+         Added ConstructorsRejectRelativePath ().
+         "file://cygwin" means machine name cygwin, not top directory cygwin.
+       * UriTest2.cs : added relative constructor tests and manually created
+         absolute uri tests (rejected by MS.NET).
+       * uri-test-generator.cs : added relative test generator.
+       * added test-uri-props-manual.txt, test-uri-relative-list.txt,
+         test-uri-relative-props.txt for relative path test and 
+         manually added tests.
+
 2004-01-04  Nick Drochak  <ndrochak@ieee.com>
 
        * UriBuilderTest.cs: Make tests pass on .NET 1.1.  
 
        * UriTest.cs: Test for UriFormatException
 
-2003-12-08  Atsushi Enomoto  <atsushi@novell.com>
+2003-12-08  Atsushi Enomoto  <atsushi@ximian.com>
 
        * UriTest2.cs : eliminating Console.WriteLine().
 
-2003-12-08  Atsushi Enomoto  <atsushi@novell.com>
+2003-12-08  Atsushi Enomoto  <atsushi@ximian.com>
 
        * Added uri-test-generator.cs, test-uri-list.txt, test-uri-props.txt
          and UriTest2.cs. They are test generator files.
index 8be2a2044afd9c05af1363740c83a6532c17764b..e83c7660d80faa5fdba49284967043242e8e66b4 100644 (file)
@@ -17,7 +17,7 @@ using System.IO;
 namespace MonoTests.System
 {
        [TestFixture]
-       public class UriTest
+       public class UriTest : Assertion
        {
                protected bool isWin32 = false;
 
@@ -67,192 +67,223 @@ namespace MonoTests.System
                        */
                        
                        uri = new Uri ("http://contoso.com?subject=uri");
-                       Assertion.AssertEquals ("#k1", "/", uri.AbsolutePath);
-                       Assertion.AssertEquals ("#k2", "http://contoso.com/?subject=uri", uri.AbsoluteUri);
-                       Assertion.AssertEquals ("#k3", "contoso.com", uri.Authority);
-                       Assertion.AssertEquals ("#k4", "", uri.Fragment);
-                       Assertion.AssertEquals ("#k5", "contoso.com", uri.Host);
-                       Assertion.AssertEquals ("#k6", UriHostNameType.Dns, uri.HostNameType);
-                       Assertion.AssertEquals ("#k7", true, uri.IsDefaultPort);
-                       Assertion.AssertEquals ("#k8", false, uri.IsFile);
-                       Assertion.AssertEquals ("#k9", false, uri.IsLoopback);
-                       Assertion.AssertEquals ("#k10", false, uri.IsUnc);
-                       Assertion.AssertEquals ("#k11", "/", uri.LocalPath);
-                       Assertion.AssertEquals ("#k12", "/?subject=uri", uri.PathAndQuery);
-                       Assertion.AssertEquals ("#k13", 80, uri.Port);
-                       Assertion.AssertEquals ("#k14", "?subject=uri", uri.Query);
-                       Assertion.AssertEquals ("#k15", "http", uri.Scheme);
-                       Assertion.AssertEquals ("#k16", false, uri.UserEscaped);
-                       Assertion.AssertEquals ("#k17", "", uri.UserInfo);
+                       AssertEquals ("#k1", "/", uri.AbsolutePath);
+                       AssertEquals ("#k2", "http://contoso.com/?subject=uri", uri.AbsoluteUri);
+                       AssertEquals ("#k3", "contoso.com", uri.Authority);
+                       AssertEquals ("#k4", "", uri.Fragment);
+                       AssertEquals ("#k5", "contoso.com", uri.Host);
+                       AssertEquals ("#k6", UriHostNameType.Dns, uri.HostNameType);
+                       AssertEquals ("#k7", true, uri.IsDefaultPort);
+                       AssertEquals ("#k8", false, uri.IsFile);
+                       AssertEquals ("#k9", false, uri.IsLoopback);
+                       AssertEquals ("#k10", false, uri.IsUnc);
+                       AssertEquals ("#k11", "/", uri.LocalPath);
+                       AssertEquals ("#k12", "/?subject=uri", uri.PathAndQuery);
+                       AssertEquals ("#k13", 80, uri.Port);
+                       AssertEquals ("#k14", "?subject=uri", uri.Query);
+                       AssertEquals ("#k15", "http", uri.Scheme);
+                       AssertEquals ("#k16", false, uri.UserEscaped);
+                       AssertEquals ("#k17", "", uri.UserInfo);
 
                        uri = new Uri ("mailto:user:pwd@contoso.com?subject=uri");
-                       Assertion.AssertEquals ("#m1", "", uri.AbsolutePath);
-                       Assertion.AssertEquals ("#m2", "mailto:user:pwd@contoso.com?subject=uri", uri.AbsoluteUri);
-                       Assertion.AssertEquals ("#m3", "contoso.com", uri.Authority);
-                       Assertion.AssertEquals ("#m4", "", uri.Fragment);
-                       Assertion.AssertEquals ("#m5", "contoso.com", uri.Host);
-                       Assertion.AssertEquals ("#m6", UriHostNameType.Dns, uri.HostNameType);
-                       Assertion.AssertEquals ("#m7", true, uri.IsDefaultPort);
-                       Assertion.AssertEquals ("#m8", false, uri.IsFile);
-                       Assertion.AssertEquals ("#m9", false, uri.IsLoopback);
-                       Assertion.AssertEquals ("#m10", false, uri.IsUnc);
-                       Assertion.AssertEquals ("#m11", "", uri.LocalPath);
-                       Assertion.AssertEquals ("#m12", "?subject=uri", uri.PathAndQuery);
-                       Assertion.AssertEquals ("#m13", 25, uri.Port);
-                       Assertion.AssertEquals ("#m14", "?subject=uri", uri.Query);
-                       Assertion.AssertEquals ("#m15", "mailto", uri.Scheme);
-                       Assertion.AssertEquals ("#m16", false, uri.UserEscaped);
-                       Assertion.AssertEquals ("#m17", "user:pwd", uri.UserInfo);
+                       AssertEquals ("#m1", "", uri.AbsolutePath);
+                       AssertEquals ("#m2", "mailto:user:pwd@contoso.com?subject=uri", uri.AbsoluteUri);
+                       AssertEquals ("#m3", "contoso.com", uri.Authority);
+                       AssertEquals ("#m4", "", uri.Fragment);
+                       AssertEquals ("#m5", "contoso.com", uri.Host);
+                       AssertEquals ("#m6", UriHostNameType.Dns, uri.HostNameType);
+                       AssertEquals ("#m7", true, uri.IsDefaultPort);
+                       AssertEquals ("#m8", false, uri.IsFile);
+                       AssertEquals ("#m9", false, uri.IsLoopback);
+                       AssertEquals ("#m10", false, uri.IsUnc);
+                       AssertEquals ("#m11", "", uri.LocalPath);
+                       AssertEquals ("#m12", "?subject=uri", uri.PathAndQuery);
+                       AssertEquals ("#m13", 25, uri.Port);
+                       AssertEquals ("#m14", "?subject=uri", uri.Query);
+                       AssertEquals ("#m15", "mailto", uri.Scheme);
+                       AssertEquals ("#m16", false, uri.UserEscaped);
+                       AssertEquals ("#m17", "user:pwd", uri.UserInfo);
                        
                        uri = new Uri (@"\\myserver\mydir\mysubdir\myfile.ext");
-                       Assertion.AssertEquals ("#n1", "/mydir/mysubdir/myfile.ext", uri.AbsolutePath);
-                       Assertion.AssertEquals ("#n2", "file://myserver/mydir/mysubdir/myfile.ext", uri.AbsoluteUri);
-                       Assertion.AssertEquals ("#n3", "myserver", uri.Authority);
-                       Assertion.AssertEquals ("#n4", "", uri.Fragment);
-                       Assertion.AssertEquals ("#n5", "myserver", uri.Host);
-                       Assertion.AssertEquals ("#n6", UriHostNameType.Dns, uri.HostNameType);
-                       Assertion.AssertEquals ("#n7", true, uri.IsDefaultPort);
-                       Assertion.AssertEquals ("#n8", true, uri.IsFile);
-                       Assertion.AssertEquals ("#n9", false, uri.IsLoopback);
-                       Assertion.AssertEquals ("#n10", true, uri.IsUnc);
+                       AssertEquals ("#n1", "/mydir/mysubdir/myfile.ext", uri.AbsolutePath);
+                       AssertEquals ("#n2", "file://myserver/mydir/mysubdir/myfile.ext", uri.AbsoluteUri);
+                       AssertEquals ("#n3", "myserver", uri.Authority);
+                       AssertEquals ("#n4", "", uri.Fragment);
+                       AssertEquals ("#n5", "myserver", uri.Host);
+                       AssertEquals ("#n6", UriHostNameType.Dns, uri.HostNameType);
+                       AssertEquals ("#n7", true, uri.IsDefaultPort);
+                       AssertEquals ("#n8", true, uri.IsFile);
+                       AssertEquals ("#n9", false, uri.IsLoopback);
+                       AssertEquals ("#n10", true, uri.IsUnc);
 
                        if (isWin32)
-                               Assertion.AssertEquals ("#n11", @"\\myserver\mydir\mysubdir\myfile.ext", uri.LocalPath);
+                               AssertEquals ("#n11", @"\\myserver\mydir\mysubdir\myfile.ext", uri.LocalPath);
                        else
-                               Assertion.AssertEquals ("#n11", "//myserver/mydir/mysubdir/myfile.ext", uri.LocalPath);
-
-                       Assertion.AssertEquals ("#n12", "/mydir/mysubdir/myfile.ext", uri.PathAndQuery);
-                       Assertion.AssertEquals ("#n13", -1, uri.Port);
-                       Assertion.AssertEquals ("#n14", "", uri.Query);
-                       Assertion.AssertEquals ("#n15", "file", uri.Scheme);
-                       Assertion.AssertEquals ("#n16", false, uri.UserEscaped);
-                       Assertion.AssertEquals ("#n17", "", uri.UserInfo);
+                               AssertEquals ("#n11", "//myserver/mydir/mysubdir/myfile.ext", uri.LocalPath);
+
+                       AssertEquals ("#n12", "/mydir/mysubdir/myfile.ext", uri.PathAndQuery);
+                       AssertEquals ("#n13", -1, uri.Port);
+                       AssertEquals ("#n14", "", uri.Query);
+                       AssertEquals ("#n15", "file", uri.Scheme);
+                       AssertEquals ("#n16", false, uri.UserEscaped);
+                       AssertEquals ("#n17", "", uri.UserInfo);
                        
                        uri = new Uri (new Uri("http://www.contoso.com"), "Hello World.htm", true);
-                       Assertion.AssertEquals ("#rel1a", "http://www.contoso.com/Hello World.htm", uri.AbsoluteUri);
-                       Assertion.AssertEquals ("#rel1b", true, uri.UserEscaped);
+                       AssertEquals ("#rel1a", "http://www.contoso.com/Hello World.htm", uri.AbsoluteUri);
+                       AssertEquals ("#rel1b", true, uri.UserEscaped);
                        uri = new Uri (new Uri("http://www.contoso.com"), "Hello World.htm", false);
-                       Assertion.AssertEquals ("#rel2a", "http://www.contoso.com/Hello%20World.htm", uri.AbsoluteUri);
-                       Assertion.AssertEquals ("#rel2b", false, uri.UserEscaped);
+                       AssertEquals ("#rel2a", "http://www.contoso.com/Hello%20World.htm", uri.AbsoluteUri);
+                       AssertEquals ("#rel2b", false, uri.UserEscaped);
                        uri = new Uri (new Uri("http://www.contoso.com"), "http://www.xxx.com/Hello World.htm", false);
-                       Assertion.AssertEquals ("#rel3", "http://www.xxx.com/Hello%20World.htm", uri.AbsoluteUri);
+                       AssertEquals ("#rel3", "http://www.xxx.com/Hello%20World.htm", uri.AbsoluteUri);
                        //uri = new Uri (new Uri("http://www.contoso.com"), "foo:8080/bar/Hello World.htm", false);
-                       //Assertion.AssertEquals ("#rel4", "foo:8080/bar/Hello%20World.htm", uri.AbsoluteUri);
+                       //AssertEquals ("#rel4", "foo:8080/bar/Hello%20World.htm", uri.AbsoluteUri);
                        uri = new Uri (new Uri("http://www.contoso.com"), "foo/bar/Hello World.htm?x=0:8", false);
-                       Assertion.AssertEquals ("#rel5", "http://www.contoso.com/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
+                       AssertEquals ("#rel5", "http://www.contoso.com/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
                        uri = new Uri (new Uri("http://www.contoso.com/xxx/yyy/index.htm"), "foo/bar/Hello World.htm?x=0:8", false);
-                       Assertion.AssertEquals ("#rel6", "http://www.contoso.com/xxx/yyy/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
+                       AssertEquals ("#rel6", "http://www.contoso.com/xxx/yyy/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
                        uri = new Uri (new Uri("http://www.contoso.com/xxx/yyy/index.htm"), "/foo/bar/Hello World.htm?x=0:8", false);
-                       Assertion.AssertEquals ("#rel7", "http://www.contoso.com/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
+                       AssertEquals ("#rel7", "http://www.contoso.com/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
                        uri = new Uri (new Uri("http://www.contoso.com/xxx/yyy/index.htm"), "../foo/bar/Hello World.htm?x=0:8", false);
-                       Assertion.AssertEquals ("#rel8", "http://www.contoso.com/xxx/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
+                       AssertEquals ("#rel8", "http://www.contoso.com/xxx/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
                        uri = new Uri (new Uri("http://www.contoso.com/xxx/yyy/index.htm"), "../../../foo/bar/Hello World.htm?x=0:8", false);
-                       Assertion.AssertEquals ("#rel9", "http://www.contoso.com/../foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
+                       AssertEquals ("#rel9", "http://www.contoso.com/../foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
                        uri = new Uri (new Uri("http://www.contoso.com/xxx/yyy/index.htm"), "./foo/bar/Hello World.htm?x=0:8", false);
-                       Assertion.AssertEquals ("#rel10", "http://www.contoso.com/xxx/yyy/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
+                       AssertEquals ("#rel10", "http://www.contoso.com/xxx/yyy/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
 
                        try {
                                uri = new Uri (null, "http://www.contoso.com/index.htm", false);
-                               Assertion.Fail ("#rel20");
+                               Fail ("#rel20");
                        } catch (NullReferenceException) {
                        }
                        try {
                                uri = new Uri (new Uri("http://www.contoso.com"), null, false);
-                               Assertion.Fail ("#rel21");
+                               Fail ("#rel21");
                        } catch (NullReferenceException) {
                        }
                        try {
                                uri = new Uri (new Uri("http://www.contoso.com/foo/bar/index.html?x=0"), String.Empty, false);
-                               Assertion.AssertEquals("#22", "http://www.contoso.com/foo/bar/index.html?x=0", uri.ToString ());
+                               AssertEquals("#22", "http://www.contoso.com/foo/bar/index.html?x=0", uri.ToString ());
                        } catch (NullReferenceException) {
                        }
 
                        uri = new Uri (new Uri("http://www.xxx.com"), "?x=0");
-                       Assertion.AssertEquals ("#rel30", "http://www.xxx.com/?x=0", uri.ToString());
+                       AssertEquals ("#rel30", "http://www.xxx.com/?x=0", uri.ToString());
                        uri = new Uri (new Uri("http://www.xxx.com/index.htm"), "?x=0");
-                       Assertion.AssertEquals ("#rel31", "http://www.xxx.com/?x=0", uri.ToString());
+                       AssertEquals ("#rel31", "http://www.xxx.com/?x=0", uri.ToString());
                        uri = new Uri (new Uri("http://www.xxx.com/index.htm"), "#here");
-                       Assertion.AssertEquals ("#rel32", "http://www.xxx.com/index.htm#here", uri.ToString());
+                       AssertEquals ("#rel32", "http://www.xxx.com/index.htm#here", uri.ToString());
                }
-               
+
+               [Test]
+               public void ConstructorsRejectRelativePath ()
+               {
+                       string [] reluris = new string [] {
+                               "readme.txt",
+                               "thisdir/childdir/file"
+                       };
+                       string [] winRelUris = new string [] {
+                               "c:readme.txt"
+                       };
+
+                       for (int i = 0; i < reluris.Length; i++) {
+                               try {
+                                       new Uri (reluris [i]);
+                                       Fail ("Should be failed: " + reluris [i]);
+                               } catch (UriFormatException) {
+                               }
+                       }
+
+                       if (isWin32) {
+                               for (int i = 0; i < winRelUris.Length; i++) {
+                                       try {
+                                               new Uri (winRelUris [i]);
+                                               Fail ("Should be failed: " + winRelUris [i]);
+                                       } catch (UriFormatException) {
+                                       }
+                               }
+                       }
+               }
+
+
                [Test]
                public void LocalPath ()
                {
                        Uri uri = new Uri ("c:\\tmp\\hello.txt");
-                       Assertion.AssertEquals ("#1a", "file:///c:/tmp/hello.txt", uri.ToString ());
-                       Assertion.AssertEquals ("#1b", "c:\\tmp\\hello.txt", uri.LocalPath);
-                       Assertion.AssertEquals ("#1c", "file", uri.Scheme);
-                       Assertion.AssertEquals ("#1d", "", uri.Host);
-                       Assertion.AssertEquals ("#1e", "c:/tmp/hello.txt", uri.AbsolutePath);
+                       AssertEquals ("#1a", "file:///c:/tmp/hello.txt", uri.ToString ());
+                       AssertEquals ("#1b", "c:\\tmp\\hello.txt", uri.LocalPath);
+                       AssertEquals ("#1c", "file", uri.Scheme);
+                       AssertEquals ("#1d", "", uri.Host);
+                       AssertEquals ("#1e", "c:/tmp/hello.txt", uri.AbsolutePath);
                                        
                        uri = new Uri ("file:////////cygwin/tmp/hello.txt");
-                       Assertion.AssertEquals ("#3a", "file://cygwin/tmp/hello.txt", uri.ToString ());
+                       AssertEquals ("#3a", "file://cygwin/tmp/hello.txt", uri.ToString ());
                        if (isWin32)
-                               Assertion.AssertEquals ("#3b win32", "\\\\cygwin\\tmp\\hello.txt", uri.LocalPath);
+                               AssertEquals ("#3b win32", "\\\\cygwin\\tmp\\hello.txt", uri.LocalPath);
                        else
-                               Assertion.AssertEquals ("#3b *nix", "/cygwin/tmp/hello.txt", uri.LocalPath);
-                       Assertion.AssertEquals ("#3c", "file", uri.Scheme);
-                       Assertion.AssertEquals ("#3d", "cygwin", uri.Host);
-                       Assertion.AssertEquals ("#3e", "/tmp/hello.txt", uri.AbsolutePath);
+                               AssertEquals ("#3b *nix", "/cygwin/tmp/hello.txt", uri.LocalPath);
+                       AssertEquals ("#3c", "file", uri.Scheme);
+                       AssertEquals ("#3d", "cygwin", uri.Host);
+                       AssertEquals ("#3e", "/tmp/hello.txt", uri.AbsolutePath);
 
                        uri = new Uri ("file://mymachine/cygwin/tmp/hello.txt");
-                       Assertion.AssertEquals ("#4a", "file://mymachine/cygwin/tmp/hello.txt", uri.ToString ());
+                       AssertEquals ("#4a", "file://mymachine/cygwin/tmp/hello.txt", uri.ToString ());
                        if (isWin32)
-                               Assertion.AssertEquals ("#4b win32", "\\\\mymachine\\cygwin\\tmp\\hello.txt", uri.LocalPath);
+                               AssertEquals ("#4b win32", "\\\\mymachine\\cygwin\\tmp\\hello.txt", uri.LocalPath);
                        else
-                               Assertion.AssertEquals ("#4b *nix", "/mymachine/cygwin/tmp/hello.txt", uri.LocalPath);
-                       Assertion.AssertEquals ("#4c", "file", uri.Scheme);
-                       Assertion.AssertEquals ("#4d", "mymachine", uri.Host);
-                       Assertion.AssertEquals ("#4e", "/cygwin/tmp/hello.txt", uri.AbsolutePath);
+                               AssertEquals ("#4b *nix", "/mymachine/cygwin/tmp/hello.txt", uri.LocalPath);
+                       AssertEquals ("#4c", "file", uri.Scheme);
+                       AssertEquals ("#4d", "mymachine", uri.Host);
+                       AssertEquals ("#4e", "/cygwin/tmp/hello.txt", uri.AbsolutePath);
                        
                        uri = new Uri ("file://///c:/cygwin/tmp/hello.txt");
-                       Assertion.AssertEquals ("#5a", "file:///c:/cygwin/tmp/hello.txt", uri.ToString ());
-                       Assertion.AssertEquals ("#5b", "c:\\cygwin\\tmp\\hello.txt", uri.LocalPath);
-                       Assertion.AssertEquals ("#5c", "file", uri.Scheme);
-                       Assertion.AssertEquals ("#5d", "", uri.Host);
-                       Assertion.AssertEquals ("#5e", "c:/cygwin/tmp/hello.txt", uri.AbsolutePath);
+                       AssertEquals ("#5a", "file:///c:/cygwin/tmp/hello.txt", uri.ToString ());
+                       AssertEquals ("#5b", "c:\\cygwin\\tmp\\hello.txt", uri.LocalPath);
+                       AssertEquals ("#5c", "file", uri.Scheme);
+                       AssertEquals ("#5d", "", uri.Host);
+                       AssertEquals ("#5e", "c:/cygwin/tmp/hello.txt", uri.AbsolutePath);
                        
                        uri = new Uri("file://one_file.txt");
-                       Assertion.AssertEquals("#6a", "file://one_file.txt", uri.ToString());
+                       AssertEquals("#6a", "file://one_file.txt", uri.ToString());
                        if (isWin32)
-                               Assertion.AssertEquals("#6b", "\\\\one_file.txt", uri.LocalPath);
+                               AssertEquals("#6b", "\\\\one_file.txt", uri.LocalPath);
                        else
-                               Assertion.AssertEquals("#6b", "/one_file.txt", uri.LocalPath);
-                       Assertion.AssertEquals("#6c", "file", uri.Scheme);
-                       Assertion.AssertEquals("#6d", "one_file.txt", uri.Host);
-                       Assertion.AssertEquals("#6e", "", uri.AbsolutePath);
+                               AssertEquals("#6b", "/one_file.txt", uri.LocalPath);
+                       AssertEquals("#6c", "file", uri.Scheme);
+                       AssertEquals("#6d", "one_file.txt", uri.Host);
+                       AssertEquals("#6e", "", uri.AbsolutePath);
                }
                
                [Test]
                public void UnixPath () {
                        if (!isWin32)
-                               Assertion.AssertEquals ("#6a", "file://cygwin/tmp/hello.txt", new Uri ("/cygwin/tmp/hello.txt").ToString ());
+                               AssertEquals ("#6a", "file:///cygwin/tmp/hello.txt", new Uri ("/cygwin/tmp/hello.txt").ToString ());
                }
                
                [Test]
                public void Unc ()
                {
                        Uri uri = new Uri ("http://www.contoso.com");
-                       Assertion.Assert ("#1", !uri.IsUnc);
+                       Assert ("#1", !uri.IsUnc);
                        
                        uri = new Uri ("news:123456@contoso.com");
-                       Assertion.Assert ("#2", !uri.IsUnc);
+                       Assert ("#2", !uri.IsUnc);
 
                        uri = new Uri ("file://server/filename.ext");
-                       Assertion.Assert ("#3", uri.IsUnc);
+                       Assert ("#3", uri.IsUnc);
 
                        uri = new Uri (@"\\server\share\filename.ext");                 
-                       Assertion.Assert ("#6", uri.IsUnc);
+                       Assert ("#6", uri.IsUnc);
 
                        uri = new Uri (@"a:\dir\filename.ext");
-                       Assertion.Assert ("#8", !uri.IsUnc);
+                       Assert ("#8", !uri.IsUnc);
                }
 
                [Test, ExpectedException (typeof (UriFormatException))]
                public void UncFail ()
                {
                        Uri uri = new Uri ("/home/user/dir/filename.ext");
-                       Assertion.Assert ("#7", !uri.IsUnc);
+                       Assert ("#7", !uri.IsUnc);
                }
 
                [Test]
@@ -261,44 +292,44 @@ namespace MonoTests.System
                {
                        try {
                                Uri uri = new Uri ("file:/filename.ext");
-                               Assertion.Assert ("#4", uri.IsUnc);
+                               Assert ("#4", uri.IsUnc);
                        } catch (UriFormatException) {
-                               Assertion.Fail ("#5: known to fail with ms.net");
+                               Fail ("#5: known to fail with ms.net");
                        }                       
                }
                
                [Test]
                public void FromHex () 
                {
-                       Assertion.AssertEquals ("#1", 0, Uri.FromHex ('0'));
-                       Assertion.AssertEquals ("#2", 9, Uri.FromHex ('9'));
-                       Assertion.AssertEquals ("#3", 10, Uri.FromHex ('a'));
-                       Assertion.AssertEquals ("#4", 15, Uri.FromHex ('f'));
-                       Assertion.AssertEquals ("#5", 10, Uri.FromHex ('A'));
-                       Assertion.AssertEquals ("#6", 15, Uri.FromHex ('F'));
+                       AssertEquals ("#1", 0, Uri.FromHex ('0'));
+                       AssertEquals ("#2", 9, Uri.FromHex ('9'));
+                       AssertEquals ("#3", 10, Uri.FromHex ('a'));
+                       AssertEquals ("#4", 15, Uri.FromHex ('f'));
+                       AssertEquals ("#5", 10, Uri.FromHex ('A'));
+                       AssertEquals ("#6", 15, Uri.FromHex ('F'));
                        try {
                                Uri.FromHex ('G');
-                               Assertion.Fail ("#7");
+                               Fail ("#7");
                        } catch (ArgumentException) {}
                        try {
                                Uri.FromHex (' ');
-                               Assertion.Fail ("#8");
+                               Fail ("#8");
                        } catch (ArgumentException) {}
                        try {
                                Uri.FromHex ('%');
-                               Assertion.Fail ("#8");
+                               Fail ("#8");
                        } catch (ArgumentException) {}
                }
 
                [Test]
                public void HexEscape () 
                {
-                       Assertion.AssertEquals ("#1","%20", Uri.HexEscape (' ')); 
-                       Assertion.AssertEquals ("#2","%A9", Uri.HexEscape ((char) 0xa9)); 
-                       Assertion.AssertEquals ("#3","%41", Uri.HexEscape ('A')); 
+                       AssertEquals ("#1","%20", Uri.HexEscape (' ')); 
+                       AssertEquals ("#2","%A9", Uri.HexEscape ((char) 0xa9)); 
+                       AssertEquals ("#3","%41", Uri.HexEscape ('A')); 
                        try {
                                Uri.HexEscape ((char) 0x0369);
-                               Assertion.Fail ("#4");
+                               Fail ("#4");
                        } catch (ArgumentOutOfRangeException) {}
                }
 
@@ -306,79 +337,79 @@ namespace MonoTests.System
                public void HexUnescape () 
                {
                        int i = 0;
-                       Assertion.AssertEquals ("#1", ' ', Uri.HexUnescape ("%20", ref i));
-                       Assertion.AssertEquals ("#2", 3, i);
+                       AssertEquals ("#1", ' ', Uri.HexUnescape ("%20", ref i));
+                       AssertEquals ("#2", 3, i);
                        i = 4;
-                       Assertion.AssertEquals ("#3", (char) 0xa9, Uri.HexUnescape ("test%a9test", ref i));
-                       Assertion.AssertEquals ("#4", 7, i);
-                       Assertion.AssertEquals ("#5", 't', Uri.HexUnescape ("test%a9test", ref i));
-                       Assertion.AssertEquals ("#6", 8, i);
+                       AssertEquals ("#3", (char) 0xa9, Uri.HexUnescape ("test%a9test", ref i));
+                       AssertEquals ("#4", 7, i);
+                       AssertEquals ("#5", 't', Uri.HexUnescape ("test%a9test", ref i));
+                       AssertEquals ("#6", 8, i);
                        i = 4;
-                       Assertion.AssertEquals ("#5", '%', Uri.HexUnescape ("test%a", ref i));
-                       Assertion.AssertEquals ("#6", 5, i);
-                       Assertion.AssertEquals ("#7", '%', Uri.HexUnescape ("testx%xx", ref i));
-                       Assertion.AssertEquals ("#8", 6, i);
+                       AssertEquals ("#5", '%', Uri.HexUnescape ("test%a", ref i));
+                       AssertEquals ("#6", 5, i);
+                       AssertEquals ("#7", '%', Uri.HexUnescape ("testx%xx", ref i));
+                       AssertEquals ("#8", 6, i);
                }
 
                [Test]
                public void IsHexDigit () 
                {
-                       Assertion.Assert ("#1", Uri.IsHexDigit ('a'));  
-                       Assertion.Assert ("#2", Uri.IsHexDigit ('f'));
-                       Assertion.Assert ("#3", !Uri.IsHexDigit ('g'));
-                       Assertion.Assert ("#4", Uri.IsHexDigit ('0'));
-                       Assertion.Assert ("#5", Uri.IsHexDigit ('9'));
-                       Assertion.Assert ("#6", Uri.IsHexDigit ('A'));
-                       Assertion.Assert ("#7", Uri.IsHexDigit ('F'));
-                       Assertion.Assert ("#8", !Uri.IsHexDigit ('G'));
+                       Assert ("#1", Uri.IsHexDigit ('a'));    
+                       Assert ("#2", Uri.IsHexDigit ('f'));
+                       Assert ("#3", !Uri.IsHexDigit ('g'));
+                       Assert ("#4", Uri.IsHexDigit ('0'));
+                       Assert ("#5", Uri.IsHexDigit ('9'));
+                       Assert ("#6", Uri.IsHexDigit ('A'));
+                       Assert ("#7", Uri.IsHexDigit ('F'));
+                       Assert ("#8", !Uri.IsHexDigit ('G'));
                }
 
                [Test]
                public void IsHexEncoding () 
                {
-                       Assertion.Assert ("#1", Uri.IsHexEncoding ("test%a9test", 4));
-                       Assertion.Assert ("#2", !Uri.IsHexEncoding ("test%a9test", 3));
-                       Assertion.Assert ("#3", Uri.IsHexEncoding ("test%a9", 4));
-                       Assertion.Assert ("#4", !Uri.IsHexEncoding ("test%a", 4));
+                       Assert ("#1", Uri.IsHexEncoding ("test%a9test", 4));
+                       Assert ("#2", !Uri.IsHexEncoding ("test%a9test", 3));
+                       Assert ("#3", Uri.IsHexEncoding ("test%a9", 4));
+                       Assert ("#4", !Uri.IsHexEncoding ("test%a", 4));
                }
                
                [Test]
                public void GetLeftPart ()
                {
                        Uri uri = new Uri ("http://www.contoso.com/index.htm#main");
-                       Assertion.AssertEquals ("#1", "http://", uri.GetLeftPart (UriPartial.Scheme));
-                       Assertion.AssertEquals ("#2", "http://www.contoso.com", uri.GetLeftPart (UriPartial.Authority));
-                       Assertion.AssertEquals ("#3", "http://www.contoso.com/index.htm", uri.GetLeftPart (UriPartial.Path));
+                       AssertEquals ("#1", "http://", uri.GetLeftPart (UriPartial.Scheme));
+                       AssertEquals ("#2", "http://www.contoso.com", uri.GetLeftPart (UriPartial.Authority));
+                       AssertEquals ("#3", "http://www.contoso.com/index.htm", uri.GetLeftPart (UriPartial.Path));
                        
                        uri = new Uri ("mailto:user@contoso.com?subject=uri");
-                       Assertion.AssertEquals ("#4", "mailto:", uri.GetLeftPart (UriPartial.Scheme));
-                       Assertion.AssertEquals ("#5", "", uri.GetLeftPart (UriPartial.Authority));
-                       Assertion.AssertEquals ("#6", "mailto:user@contoso.com", uri.GetLeftPart (UriPartial.Path));
+                       AssertEquals ("#4", "mailto:", uri.GetLeftPart (UriPartial.Scheme));
+                       AssertEquals ("#5", "", uri.GetLeftPart (UriPartial.Authority));
+                       AssertEquals ("#6", "mailto:user@contoso.com", uri.GetLeftPart (UriPartial.Path));
 
                        uri = new Uri ("nntp://news.contoso.com/123456@contoso.com");
-                       Assertion.AssertEquals ("#7", "nntp://", uri.GetLeftPart (UriPartial.Scheme));
-                       Assertion.AssertEquals ("#8", "nntp://news.contoso.com", uri.GetLeftPart (UriPartial.Authority));
-                       Assertion.AssertEquals ("#9", "nntp://news.contoso.com/123456@contoso.com", uri.GetLeftPart (UriPartial.Path));                 
+                       AssertEquals ("#7", "nntp://", uri.GetLeftPart (UriPartial.Scheme));
+                       AssertEquals ("#8", "nntp://news.contoso.com", uri.GetLeftPart (UriPartial.Authority));
+                       AssertEquals ("#9", "nntp://news.contoso.com/123456@contoso.com", uri.GetLeftPart (UriPartial.Path));                   
                        
                        uri = new Uri ("news:123456@contoso.com");
-                       Assertion.AssertEquals ("#10", "news:", uri.GetLeftPart (UriPartial.Scheme));
-                       Assertion.AssertEquals ("#11", "", uri.GetLeftPart (UriPartial.Authority));
-                       Assertion.AssertEquals ("#12", "news:123456@contoso.com", uri.GetLeftPart (UriPartial.Path));                   
+                       AssertEquals ("#10", "news:", uri.GetLeftPart (UriPartial.Scheme));
+                       AssertEquals ("#11", "", uri.GetLeftPart (UriPartial.Authority));
+                       AssertEquals ("#12", "news:123456@contoso.com", uri.GetLeftPart (UriPartial.Path));                     
 
                        uri = new Uri ("file://server/filename.ext");
-                       Assertion.AssertEquals ("#13", "file://", uri.GetLeftPart (UriPartial.Scheme));
-                       Assertion.AssertEquals ("#14", "file://server", uri.GetLeftPart (UriPartial.Authority));
-                       Assertion.AssertEquals ("#15", "file://server/filename.ext", uri.GetLeftPart (UriPartial.Path));                        
+                       AssertEquals ("#13", "file://", uri.GetLeftPart (UriPartial.Scheme));
+                       AssertEquals ("#14", "file://server", uri.GetLeftPart (UriPartial.Authority));
+                       AssertEquals ("#15", "file://server/filename.ext", uri.GetLeftPart (UriPartial.Path));                  
 
                        uri = new Uri (@"\\server\share\filename.ext");
-                       Assertion.AssertEquals ("#20", "file://", uri.GetLeftPart (UriPartial.Scheme));
-                       Assertion.AssertEquals ("#21", "file://server", uri.GetLeftPart (UriPartial.Authority));
-                       Assertion.AssertEquals ("#22", "file://server/share/filename.ext", uri.GetLeftPart (UriPartial.Path));
+                       AssertEquals ("#20", "file://", uri.GetLeftPart (UriPartial.Scheme));
+                       AssertEquals ("#21", "file://server", uri.GetLeftPart (UriPartial.Authority));
+                       AssertEquals ("#22", "file://server/share/filename.ext", uri.GetLeftPart (UriPartial.Path));
                        
                        uri = new Uri ("http://www.contoso.com:8080/index.htm#main");
-                       Assertion.AssertEquals ("#23", "http://", uri.GetLeftPart (UriPartial.Scheme));
-                       Assertion.AssertEquals ("#24", "http://www.contoso.com:8080", uri.GetLeftPart (UriPartial.Authority));
-                       Assertion.AssertEquals ("#25", "http://www.contoso.com:8080/index.htm", uri.GetLeftPart (UriPartial.Path));
+                       AssertEquals ("#23", "http://", uri.GetLeftPart (UriPartial.Scheme));
+                       AssertEquals ("#24", "http://www.contoso.com:8080", uri.GetLeftPart (UriPartial.Authority));
+                       AssertEquals ("#25", "http://www.contoso.com:8080/index.htm", uri.GetLeftPart (UriPartial.Path));
                }
                
                [Test]
@@ -387,95 +418,95 @@ namespace MonoTests.System
                {
                        try {
                                Uri uri = new Uri ("file:/filename.ext");
-                               Assertion.AssertEquals ("#16", "file://", uri.GetLeftPart (UriPartial.Scheme));
-                               Assertion.AssertEquals ("#17", "", uri.GetLeftPart (UriPartial.Authority));
-                               Assertion.AssertEquals ("#18", "file:///filename.ext", uri.GetLeftPart (UriPartial.Path));                      
+                               AssertEquals ("#16", "file://", uri.GetLeftPart (UriPartial.Scheme));
+                               AssertEquals ("#17", "", uri.GetLeftPart (UriPartial.Authority));
+                               AssertEquals ("#18", "file:///filename.ext", uri.GetLeftPart (UriPartial.Path));                        
                        } catch (UriFormatException) {
-                               Assertion.Fail ("#19: known to fail with ms.net (it's their own example!)");
+                               Fail ("#19: known to fail with ms.net (it's their own example!)");
                        }                       
                }
 
                [Test]
                public void CheckHostName ()
                {
-                       Assertion.AssertEquals ("#1", UriHostNameType.Unknown, Uri.CheckHostName (null));
-                       Assertion.AssertEquals ("#2", UriHostNameType.Unknown, Uri.CheckHostName (""));
-                       Assertion.AssertEquals ("#3", UriHostNameType.Unknown, Uri.CheckHostName ("^&()~`!@"));
-                       Assertion.AssertEquals ("#4", UriHostNameType.Dns, Uri.CheckHostName ("x"));
-                       Assertion.AssertEquals ("#5", UriHostNameType.IPv4, Uri.CheckHostName ("1.2.3.4"));
-                       Assertion.AssertEquals ("#6", UriHostNameType.IPv4, Uri.CheckHostName ("0001.002.03.4"));
-                       Assertion.AssertEquals ("#7", UriHostNameType.Dns, Uri.CheckHostName ("0001.002.03.256"));
-                       Assertion.AssertEquals ("#8", UriHostNameType.Dns, Uri.CheckHostName ("9001.002.03.4"));
-                       Assertion.AssertEquals ("#9", UriHostNameType.Dns, Uri.CheckHostName ("www.contoso.com"));
-                       Assertion.AssertEquals ("#10", UriHostNameType.Unknown, Uri.CheckHostName (".www.contoso.com"));
-                       Assertion.AssertEquals ("#11: known to fail with ms.net: this is not a valid domain address", UriHostNameType.Unknown, Uri.CheckHostName ("www.contoso.com.")); 
-                       Assertion.AssertEquals ("#12", UriHostNameType.Dns, Uri.CheckHostName ("www.con-toso.com"));    
-                       Assertion.AssertEquals ("#13", UriHostNameType.Dns, Uri.CheckHostName ("www.con_toso.com"));    
-                       Assertion.AssertEquals ("#14", UriHostNameType.Unknown, Uri.CheckHostName ("www.con,toso.com"));        
+                       AssertEquals ("#1", UriHostNameType.Unknown, Uri.CheckHostName (null));
+                       AssertEquals ("#2", UriHostNameType.Unknown, Uri.CheckHostName (""));
+                       AssertEquals ("#3", UriHostNameType.Unknown, Uri.CheckHostName ("^&()~`!@"));
+                       AssertEquals ("#4", UriHostNameType.Dns, Uri.CheckHostName ("x"));
+                       AssertEquals ("#5", UriHostNameType.IPv4, Uri.CheckHostName ("1.2.3.4"));
+                       AssertEquals ("#6", UriHostNameType.IPv4, Uri.CheckHostName ("0001.002.03.4"));
+                       AssertEquals ("#7", UriHostNameType.Dns, Uri.CheckHostName ("0001.002.03.256"));
+                       AssertEquals ("#8", UriHostNameType.Dns, Uri.CheckHostName ("9001.002.03.4"));
+                       AssertEquals ("#9", UriHostNameType.Dns, Uri.CheckHostName ("www.contoso.com"));
+                       AssertEquals ("#10", UriHostNameType.Unknown, Uri.CheckHostName (".www.contoso.com"));
+                       AssertEquals ("#11: known to fail with ms.net: this is not a valid domain address", UriHostNameType.Unknown, Uri.CheckHostName ("www.contoso.com."));   
+                       AssertEquals ("#12", UriHostNameType.Dns, Uri.CheckHostName ("www.con-toso.com"));      
+                       AssertEquals ("#13", UriHostNameType.Dns, Uri.CheckHostName ("www.con_toso.com"));      
+                       AssertEquals ("#14", UriHostNameType.Unknown, Uri.CheckHostName ("www.con,toso.com"));  
                        
                        // test IPv6
-                       Assertion.AssertEquals ("#15", UriHostNameType.IPv6, Uri.CheckHostName ("11:22:33:44:55:66:77:88"));
-                       Assertion.AssertEquals ("#16", UriHostNameType.IPv6, Uri.CheckHostName ("11::33:44:55:66:77:88"));
-                       Assertion.AssertEquals ("#17", UriHostNameType.IPv6, Uri.CheckHostName ("::22:33:44:55:66:77:88"));
-                       Assertion.AssertEquals ("#18", UriHostNameType.IPv6, Uri.CheckHostName ("11:22:33:44:55:66:77::"));
-                       Assertion.AssertEquals ("#19", UriHostNameType.IPv6, Uri.CheckHostName ("11::88"));
-                       Assertion.AssertEquals ("#20", UriHostNameType.IPv6, Uri.CheckHostName ("11::77:88"));
-                       Assertion.AssertEquals ("#21", UriHostNameType.IPv6, Uri.CheckHostName ("11:22::88"));
-                       Assertion.AssertEquals ("#22", UriHostNameType.IPv6, Uri.CheckHostName ("11::"));
-                       Assertion.AssertEquals ("#23", UriHostNameType.IPv6, Uri.CheckHostName ("::88"));
-                       Assertion.AssertEquals ("#24", UriHostNameType.IPv6, Uri.CheckHostName ("::1"));
-                       Assertion.AssertEquals ("#25", UriHostNameType.IPv6, Uri.CheckHostName ("::"));
-                       Assertion.AssertEquals ("#26", UriHostNameType.IPv6, Uri.CheckHostName ("0:0:0:0:0:0:127.0.0.1"));
-                       Assertion.AssertEquals ("#27", UriHostNameType.IPv6, Uri.CheckHostName ("::127.0.0.1"));
-                       Assertion.AssertEquals ("#28", UriHostNameType.IPv6, Uri.CheckHostName ("::ffFF:169.32.14.5"));
-                       Assertion.AssertEquals ("#29", UriHostNameType.IPv6, Uri.CheckHostName ("2001:03A0::/35"));
-                       Assertion.AssertEquals ("#30", UriHostNameType.IPv6, Uri.CheckHostName ("[2001:03A0::/35]"));
-
-                       Assertion.AssertEquals ("#31", UriHostNameType.Unknown, Uri.CheckHostName ("2001::03A0::/35"));
-                       Assertion.AssertEquals ("#32", UriHostNameType.Unknown, Uri.CheckHostName ("2001:03A0::/35a"));
-                       Assertion.AssertEquals ("#33 known to fail with ms.net: this is not a valid IPv6 address.", UriHostNameType.Unknown, Uri.CheckHostName ("2001::03A0:1.2.3.4"));
-                       Assertion.AssertEquals ("#34", UriHostNameType.Unknown, Uri.CheckHostName ("::ffff:123.256.155.43"));
-                       Assertion.AssertEquals ("#35", UriHostNameType.Unknown, Uri.CheckHostName (":127.0.0.1"));
-                       Assertion.AssertEquals ("#36 known to fail with ms.net: this is not a valid IPv6 address.", UriHostNameType.Unknown, Uri.CheckHostName (":11:22:33:44:55:66:77:88"));
-                       Assertion.AssertEquals ("#37", UriHostNameType.Unknown, Uri.CheckHostName ("::11:22:33:44:55:66:77:88"));
-                       Assertion.AssertEquals ("#38", UriHostNameType.Unknown, Uri.CheckHostName ("11:22:33:44:55:66:77:88::"));
-                       Assertion.AssertEquals ("#39", UriHostNameType.Unknown, Uri.CheckHostName ("11:22:33:44:55:66:77:88:"));
-                       Assertion.AssertEquals ("#40", UriHostNameType.Unknown, Uri.CheckHostName ("::acbde"));
-                       Assertion.AssertEquals ("#41", UriHostNameType.Unknown, Uri.CheckHostName ("::abce:"));
-                       Assertion.AssertEquals ("#42", UriHostNameType.Unknown, Uri.CheckHostName ("::abcg"));
-                       Assertion.AssertEquals ("#43", UriHostNameType.Unknown, Uri.CheckHostName (":::"));
-                       Assertion.AssertEquals ("#44", UriHostNameType.Unknown, Uri.CheckHostName (":"));
+                       AssertEquals ("#15", UriHostNameType.IPv6, Uri.CheckHostName ("11:22:33:44:55:66:77:88"));
+                       AssertEquals ("#16", UriHostNameType.IPv6, Uri.CheckHostName ("11::33:44:55:66:77:88"));
+                       AssertEquals ("#17", UriHostNameType.IPv6, Uri.CheckHostName ("::22:33:44:55:66:77:88"));
+                       AssertEquals ("#18", UriHostNameType.IPv6, Uri.CheckHostName ("11:22:33:44:55:66:77::"));
+                       AssertEquals ("#19", UriHostNameType.IPv6, Uri.CheckHostName ("11::88"));
+                       AssertEquals ("#20", UriHostNameType.IPv6, Uri.CheckHostName ("11::77:88"));
+                       AssertEquals ("#21", UriHostNameType.IPv6, Uri.CheckHostName ("11:22::88"));
+                       AssertEquals ("#22", UriHostNameType.IPv6, Uri.CheckHostName ("11::"));
+                       AssertEquals ("#23", UriHostNameType.IPv6, Uri.CheckHostName ("::88"));
+                       AssertEquals ("#24", UriHostNameType.IPv6, Uri.CheckHostName ("::1"));
+                       AssertEquals ("#25", UriHostNameType.IPv6, Uri.CheckHostName ("::"));
+                       AssertEquals ("#26", UriHostNameType.IPv6, Uri.CheckHostName ("0:0:0:0:0:0:127.0.0.1"));
+                       AssertEquals ("#27", UriHostNameType.IPv6, Uri.CheckHostName ("::127.0.0.1"));
+                       AssertEquals ("#28", UriHostNameType.IPv6, Uri.CheckHostName ("::ffFF:169.32.14.5"));
+                       AssertEquals ("#29", UriHostNameType.IPv6, Uri.CheckHostName ("2001:03A0::/35"));
+                       AssertEquals ("#30", UriHostNameType.IPv6, Uri.CheckHostName ("[2001:03A0::/35]"));
+
+                       AssertEquals ("#31", UriHostNameType.Unknown, Uri.CheckHostName ("2001::03A0::/35"));
+                       AssertEquals ("#32", UriHostNameType.Unknown, Uri.CheckHostName ("2001:03A0::/35a"));
+                       AssertEquals ("#33 known to fail with ms.net: this is not a valid IPv6 address.", UriHostNameType.Unknown, Uri.CheckHostName ("2001::03A0:1.2.3.4"));
+                       AssertEquals ("#34", UriHostNameType.Unknown, Uri.CheckHostName ("::ffff:123.256.155.43"));
+                       AssertEquals ("#35", UriHostNameType.Unknown, Uri.CheckHostName (":127.0.0.1"));
+                       AssertEquals ("#36 known to fail with ms.net: this is not a valid IPv6 address.", UriHostNameType.Unknown, Uri.CheckHostName (":11:22:33:44:55:66:77:88"));
+                       AssertEquals ("#37", UriHostNameType.Unknown, Uri.CheckHostName ("::11:22:33:44:55:66:77:88"));
+                       AssertEquals ("#38", UriHostNameType.Unknown, Uri.CheckHostName ("11:22:33:44:55:66:77:88::"));
+                       AssertEquals ("#39", UriHostNameType.Unknown, Uri.CheckHostName ("11:22:33:44:55:66:77:88:"));
+                       AssertEquals ("#40", UriHostNameType.Unknown, Uri.CheckHostName ("::acbde"));
+                       AssertEquals ("#41", UriHostNameType.Unknown, Uri.CheckHostName ("::abce:"));
+                       AssertEquals ("#42", UriHostNameType.Unknown, Uri.CheckHostName ("::abcg"));
+                       AssertEquals ("#43", UriHostNameType.Unknown, Uri.CheckHostName (":::"));
+                       AssertEquals ("#44", UriHostNameType.Unknown, Uri.CheckHostName (":"));
                }
                
                [Test]
                public void IsLoopback ()
                {
                        Uri uri = new Uri("http://loopback:8080");
-                       Assertion.AssertEquals ("#1", true, uri.IsLoopback);
+                       AssertEquals ("#1", true, uri.IsLoopback);
                        uri = new Uri("http://localhost:8080");
-                       Assertion.AssertEquals ("#2", true, uri.IsLoopback);
+                       AssertEquals ("#2", true, uri.IsLoopback);
                        uri = new Uri("http://127.0.0.1:8080");
-                       Assertion.AssertEquals ("#3", true, uri.IsLoopback);
+                       AssertEquals ("#3", true, uri.IsLoopback);
                        uri = new Uri("http://127.0.0.001:8080");
-                       Assertion.AssertEquals ("#4", true, uri.IsLoopback);
+                       AssertEquals ("#4", true, uri.IsLoopback);
                        uri = new Uri("http://[::1]");
-                       Assertion.AssertEquals ("#5", true, uri.IsLoopback);
+                       AssertEquals ("#5", true, uri.IsLoopback);
                        uri = new Uri("http://[::1]:8080");
-                       Assertion.AssertEquals ("#6", true, uri.IsLoopback);
+                       AssertEquals ("#6", true, uri.IsLoopback);
                        uri = new Uri("http://[::0001]:8080");
-                       Assertion.AssertEquals ("#7", true, uri.IsLoopback);
+                       AssertEquals ("#7", true, uri.IsLoopback);
                        uri = new Uri("http://[0:0:0:0::1]:8080");
-                       Assertion.AssertEquals ("#8", true, uri.IsLoopback);
+                       AssertEquals ("#8", true, uri.IsLoopback);
                        uri = new Uri("http://[0:0:0:0::127.0.0.1]:8080");
-                       Assertion.AssertEquals ("#9", true, uri.IsLoopback);
+                       AssertEquals ("#9", true, uri.IsLoopback);
                        uri = new Uri("http://[0:0:0:0::127.11.22.33]:8080");
-                       Assertion.AssertEquals ("#10: known to fail with ms.net", true, uri.IsLoopback);
+                       AssertEquals ("#10: known to fail with ms.net", true, uri.IsLoopback);
                        uri = new Uri("http://[::ffff:127.11.22.33]:8080");
-                       Assertion.AssertEquals ("#11: known to fail with ms.net", true, uri.IsLoopback);
+                       AssertEquals ("#11: known to fail with ms.net", true, uri.IsLoopback);
                        uri = new Uri("http://[::ff00:7f11:2233]:8080");
-                       Assertion.AssertEquals ("#12", false, uri.IsLoopback);
+                       AssertEquals ("#12", false, uri.IsLoopback);
                        uri = new Uri("http://[1:0:0:0::1]:8080");
-                       Assertion.AssertEquals ("#13", false, uri.IsLoopback);
+                       AssertEquals ("#13", false, uri.IsLoopback);
                }
                
                [Test]
@@ -483,11 +514,11 @@ namespace MonoTests.System
                {
                        Uri uri1 = new Uri ("http://www.contoso.com/index.htm#main");
                        Uri uri2 = new Uri ("http://www.contoso.com/index.htm#fragment");
-                       Assertion.Assert ("#1", uri1.Equals (uri2));
+                       Assert ("#1", uri1.Equals (uri2));
                        uri2 = new Uri ("http://www.contoso.com/index.htm?x=1");
-                       Assertion.Assert ("#2 known to fail with ms.net", !uri1.Equals (uri2));
-                       Assertion.Assert ("#3", !uri2.Equals ("http://www.contoso.com/index.html?x=1"));
-                       Assertion.Assert ("#4: known to fail with ms.net", !uri1.Equals ("http://www.contoso.com:8080/index.htm?x=1"));
+                       Assert ("#2 known to fail with ms.net", !uri1.Equals (uri2));
+                       Assert ("#3", !uri2.Equals ("http://www.contoso.com/index.html?x=1"));
+                       Assert ("#4: known to fail with ms.net", !uri1.Equals ("http://www.contoso.com:8080/index.htm?x=1"));
                }
                
                [Test]
@@ -495,13 +526,13 @@ namespace MonoTests.System
                {
                        Uri uri1 = new Uri ("http://www.contoso.com/index.htm#main");
                        Uri uri2 = new Uri ("http://www.contoso.com/index.htm#fragment");
-                       Assertion.AssertEquals ("#1", uri1.GetHashCode (), uri2.GetHashCode ());
+                       AssertEquals ("#1", uri1.GetHashCode (), uri2.GetHashCode ());
                        uri2 = new Uri ("http://www.contoso.com/index.htm?x=1");
-                       Assertion.Assert ("#2", uri1.GetHashCode () != uri2.GetHashCode ());
+                       Assert ("#2", uri1.GetHashCode () != uri2.GetHashCode ());
                        uri2 = new Uri ("http://www.contoso.com:80/index.htm");
-                       Assertion.AssertEquals ("#3", uri1.GetHashCode (), uri2.GetHashCode ());                        
+                       AssertEquals ("#3", uri1.GetHashCode (), uri2.GetHashCode ());                  
                        uri2 = new Uri ("http://www.contoso.com:8080/index.htm");
-                       Assertion.Assert ("#4", uri1.GetHashCode () != uri2.GetHashCode ());                    
+                       Assert ("#4", uri1.GetHashCode () != uri2.GetHashCode ());                      
                }
                
                [Test]
@@ -516,59 +547,59 @@ namespace MonoTests.System
                        Uri uri7 = new Uri ("http://www.contoso2.com/bar/foo/foobar.htm?z=0&y=5");
                        Uri uri8 = new Uri ("http://www.xxx.com/bar/foo/foobar.htm?z=0&y=5" + (char) 0xa9);
 
-                       Assertion.AssertEquals ("#1", "foo/bar/index.htm", uri1.MakeRelative (uri2));
-                       Assertion.AssertEquals ("#2", "../../index.htm", uri2.MakeRelative (uri1));
+                       AssertEquals ("#1", "foo/bar/index.htm", uri1.MakeRelative (uri2));
+                       AssertEquals ("#2", "../../index.htm", uri2.MakeRelative (uri1));
                        
-                       Assertion.AssertEquals ("#3", "../../bar/foo/index.htm", uri2.MakeRelative (uri3));
-                       Assertion.AssertEquals ("#4", "../../foo/bar/index.htm", uri3.MakeRelative (uri2));                     
+                       AssertEquals ("#3", "../../bar/foo/index.htm", uri2.MakeRelative (uri3));
+                       AssertEquals ("#4", "../../foo/bar/index.htm", uri3.MakeRelative (uri2));                       
 
-                       Assertion.AssertEquals ("#5", "../foo2/index.htm", uri3.MakeRelative (uri4));
-                       Assertion.AssertEquals ("#6", "../foo/index.htm", uri4.MakeRelative (uri3));
+                       AssertEquals ("#5", "../foo2/index.htm", uri3.MakeRelative (uri4));
+                       AssertEquals ("#6", "../foo/index.htm", uri4.MakeRelative (uri3));
                        
-                       Assertion.AssertEquals ("#7", "https://www.contoso.com/bar/foo/index.htm?y=1", 
+                       AssertEquals ("#7", "https://www.contoso.com/bar/foo/index.htm?y=1", 
                                            uri4.MakeRelative (uri5));
 
-                       Assertion.AssertEquals ("#8", "http://www.contoso2.com/bar/foo/index.htm?x=0", 
+                       AssertEquals ("#8", "http://www.contoso2.com/bar/foo/index.htm?x=0", 
                                            uri4.MakeRelative (uri6));
 
-                       Assertion.AssertEquals ("#9", "", uri6.MakeRelative (uri6));
-                       Assertion.AssertEquals ("#10", "foobar.htm", uri6.MakeRelative (uri7));
+                       AssertEquals ("#9", "", uri6.MakeRelative (uri6));
+                       AssertEquals ("#10", "foobar.htm", uri6.MakeRelative (uri7));
                        
                        Uri uri10 = new Uri ("mailto:xxx@xxx.com");
                        Uri uri11 = new Uri ("mailto:xxx@xxx.com?subject=hola");
-                       Assertion.AssertEquals ("#11", "", uri10.MakeRelative (uri11));
+                       AssertEquals ("#11", "", uri10.MakeRelative (uri11));
                        
                        Uri uri12 = new Uri ("mailto:xxx@mail.xxx.com?subject=hola");
-                       Assertion.AssertEquals ("#12", "mailto:xxx@mail.xxx.com?subject=hola", uri10.MakeRelative (uri12));
+                       AssertEquals ("#12", "mailto:xxx@mail.xxx.com?subject=hola", uri10.MakeRelative (uri12));
                                                
                        Uri uri13 = new Uri ("mailto:xxx@xxx.com/foo/bar");
-                       Assertion.AssertEquals ("#13", "/foo/bar", uri10.MakeRelative (uri13));
+                       AssertEquals ("#13", "/foo/bar", uri10.MakeRelative (uri13));
                        
-                       Assertion.AssertEquals ("#14", "http://www.xxx.com/bar/foo/foobar.htm?z=0&y=5" + (char) 0xa9, uri1.MakeRelative (uri8));
+                       AssertEquals ("#14", "http://www.xxx.com/bar/foo/foobar.htm?z=0&y=5" + (char) 0xa9, uri1.MakeRelative (uri8));
                }
                
                [Test]
                public void ToStringTest()
                {                       
                        Uri uri = new Uri ("dummy://xxx");
-                       Assertion.AssertEquals ("#1", "dummy://xxx/", uri.ToString ());
+                       AssertEquals ("#1", "dummy://xxx/", uri.ToString ());
                }
 
                [Test]
                public void CheckSchemeName ()
                {
-                       Assertion.AssertEquals ("#01", false, Uri.CheckSchemeName (null));
-                       Assertion.AssertEquals ("#02", false, Uri.CheckSchemeName (""));
-                       Assertion.AssertEquals ("#03", true, Uri.CheckSchemeName ("http"));
-                       Assertion.AssertEquals ("#04", true, Uri.CheckSchemeName ("http-"));
-                       Assertion.AssertEquals ("#05", false, Uri.CheckSchemeName ("6http-"));
-                       Assertion.AssertEquals ("#06", true, Uri.CheckSchemeName ("http6-"));
-                       Assertion.AssertEquals ("#07", false, Uri.CheckSchemeName ("http6,"));
-                       Assertion.AssertEquals ("#08", true, Uri.CheckSchemeName ("http6."));
-                       Assertion.AssertEquals ("#09", false, Uri.CheckSchemeName ("+http"));
-                       Assertion.AssertEquals ("#10", true, Uri.CheckSchemeName ("htt+p6"));
+                       AssertEquals ("#01", false, Uri.CheckSchemeName (null));
+                       AssertEquals ("#02", false, Uri.CheckSchemeName (""));
+                       AssertEquals ("#03", true, Uri.CheckSchemeName ("http"));
+                       AssertEquals ("#04", true, Uri.CheckSchemeName ("http-"));
+                       AssertEquals ("#05", false, Uri.CheckSchemeName ("6http-"));
+                       AssertEquals ("#06", true, Uri.CheckSchemeName ("http6-"));
+                       AssertEquals ("#07", false, Uri.CheckSchemeName ("http6,"));
+                       AssertEquals ("#08", true, Uri.CheckSchemeName ("http6."));
+                       AssertEquals ("#09", false, Uri.CheckSchemeName ("+http"));
+                       AssertEquals ("#10", true, Uri.CheckSchemeName ("htt+p6"));
                        // 0x00E1 -> &atilde;
-                       Assertion.AssertEquals ("#11", true, Uri.CheckSchemeName ("htt\u00E1+p6"));
+                       AssertEquals ("#11", true, Uri.CheckSchemeName ("htt\u00E1+p6"));
                }
 
                [Test]
@@ -591,8 +622,8 @@ namespace MonoTests.System
                {
                        Uri uri = new Uri ("http://localhost/");
                        string [] segments = uri.Segments;
-                       Assertion.AssertEquals ("#01", 1, segments.Length);
-                       Assertion.AssertEquals ("#02", "/", segments [0]);
+                       AssertEquals ("#01", 1, segments.Length);
+                       AssertEquals ("#02", "/", segments [0]);
                        
                }
 
@@ -601,10 +632,10 @@ namespace MonoTests.System
                {
                        Uri uri = new Uri ("http://localhost/dir/dummypage.html");
                        string [] segments = uri.Segments;
-                       Assertion.AssertEquals ("#01", 3, segments.Length);
-                       Assertion.AssertEquals ("#02", "/", segments [0]);
-                       Assertion.AssertEquals ("#03", "dir/", segments [1]);
-                       Assertion.AssertEquals ("#04", "dummypage.html", segments [2]);
+                       AssertEquals ("#01", 3, segments.Length);
+                       AssertEquals ("#02", "/", segments [0]);
+                       AssertEquals ("#03", "dir/", segments [1]);
+                       AssertEquals ("#04", "dummypage.html", segments [2]);
                        
                }
 
@@ -613,10 +644,10 @@ namespace MonoTests.System
                {
                        Uri uri = new Uri ("http://localhost/dir/dummypage/");
                        string [] segments = uri.Segments;
-                       Assertion.AssertEquals ("#01", 3, segments.Length);
-                       Assertion.AssertEquals ("#02", "/", segments [0]);
-                       Assertion.AssertEquals ("#03", "dir/", segments [1]);
-                       Assertion.AssertEquals ("#04", "dummypage/", segments [2]);
+                       AssertEquals ("#01", 3, segments.Length);
+                       AssertEquals ("#02", "/", segments [0]);
+                       AssertEquals ("#03", "dir/", segments [1]);
+                       AssertEquals ("#04", "dummypage/", segments [2]);
                        
                }
 
@@ -625,10 +656,10 @@ namespace MonoTests.System
                {
                        Uri uri = new Uri ("file:///c:/hello");
                        string [] segments = uri.Segments;
-                       Assertion.AssertEquals ("#01", 3, segments.Length);
-                       Assertion.AssertEquals ("#02", "c:", segments [0]);
-                       Assertion.AssertEquals ("#03", "/", segments [1]);
-                       Assertion.AssertEquals ("#04", "hello", segments [2]);
+                       AssertEquals ("#01", 3, segments.Length);
+                       AssertEquals ("#02", "c:", segments [0]);
+                       AssertEquals ("#03", "/", segments [1]);
+                       AssertEquals ("#04", "hello", segments [2]);
                        
                }
 
index e2d21ad8b6e0c829de70251a930d4539e287d055..9d102d9190efbd84cad9cb59b39b3fa38c707c5e 100755 (executable)
@@ -48,20 +48,38 @@ namespace MonoTests.System
                }\r
 \r
                [Test]\r
-               public void TestFromFile ()\r
+               public void AbsoluteUriFromFile ()\r
                {\r
-                       StreamReader sr = new StreamReader ("Test/System/test-uri-props.txt", Encoding.UTF8);\r
+                       FromFile ("Test/System/test-uri-props.txt", null);\r
+               }\r
+               \r
+               [Test]\r
+               public void AbsoluteUriFromFileManual ()\r
+               {\r
+                       FromFile ("Test/System/test-uri-props-manual.txt", null);\r
+               }\r
+               \r
+               [Test]\r
+               public void RelativeUriFromFile ()\r
+               {\r
+                       FromFile ("Test/System/test-uri-relative-props.txt", new Uri ("http://www.go-mono.com"));\r
+               }\r
+               \r
+               private void FromFile (string testFile, Uri baseUri)\r
+               {\r
+                       StreamReader sr = new StreamReader (testFile, Encoding.UTF8);\r
                        while (sr.Peek () > 0) {\r
                                sr.ReadLine (); // skip\r
                                string uriString = sr.ReadLine ();\r
-//TextWriter sw = Console.Out;\r
-//                             sw.WriteLine ("-------------------------");\r
-//                             sw.WriteLine (uriString);\r
-\r
+/*\r
+TextWriter sw = Console.Out;\r
+                               sw.WriteLine ("-------------------------");\r
+                               sw.WriteLine (uriString);\r
+*/\r
                                if (uriString == null || uriString.Length == 0)\r
                                        break;\r
 \r
-                               Uri uri = new Uri (uriString);\r
+                               Uri uri = baseUri == null ? new Uri (uriString) : new Uri (baseUri, uriString);\r
 /*\r
                                sw.WriteLine ("ToString(): " + uri.ToString ());\r
                                sw.WriteLine (uri.AbsoluteUri);\r
@@ -103,48 +121,5 @@ namespace MonoTests.System
                        }\r
                }\r
 \r
-/*\r
-               public static void Main (string [] args)\r
-               {\r
-                       StreamReader sr = new StreamReader ("test-uri-list.txt", Encoding.UTF8);\r
-                       StreamWriter sw = new StreamWriter ("test-uri-props.txt", false, Encoding.UTF8);\r
-\r
-                       GenerateResult (sr, sw, null);\r
-               }\r
-\r
-               public static void GenerateResult (TextReader sr, TextWriter sw, Uri baseUri)\r
-               {\r
-                       while (sr.Peek () > 0) {\r
-                               string uriString = sr.ReadLine ();\r
-                               if (uriString.Length == 0 || uriString [0] == '#')\r
-                                       continue;\r
-                               Uri uri = (baseUri == null) ?\r
-                                       new Uri (uriString) : new Uri (baseUri, uriString);\r
-\r
-                               sw.WriteLine ("-------------------------");\r
-                               sw.WriteLine (uriString);\r
-                               sw.WriteLine (uri.ToString ());\r
-                               sw.WriteLine (uri.AbsoluteUri);\r
-                               sw.WriteLine (uri.Scheme);\r
-                               sw.WriteLine (uri.Host);\r
-                               sw.WriteLine (uri.LocalPath);\r
-                               sw.WriteLine (uri.Query);\r
-                               sw.WriteLine (uri.Port);\r
-                               sw.WriteLine (uri.IsFile);\r
-                               sw.WriteLine (uri.IsUnc);\r
-                               sw.WriteLine (uri.IsLoopback);\r
-                               sw.WriteLine (uri.UserEscaped);\r
-                               sw.WriteLine (uri.HostNameType);\r
-                               sw.WriteLine (uri.AbsolutePath);\r
-                               sw.WriteLine (uri.PathAndQuery);\r
-                               sw.WriteLine (uri.Authority);\r
-                               sw.WriteLine (uri.Fragment);\r
-                               sw.WriteLine (uri.UserInfo);\r
-                       }\r
-                       sr.Close ();\r
-                       sw.Close ();\r
-               }\r
-*/\r
-\r
        }\r
 }\r
diff --git a/mcs/class/System/Test/System/test-uri-props-manual.txt b/mcs/class/System/Test/System/test-uri-props-manual.txt
new file mode 100755 (executable)
index 0000000..b496771
--- /dev/null
@@ -0,0 +1,38 @@
+-------------------------\r
+/foo.txt\r
+file:///foo.txt\r
+file:///foo.txt\r
+file\r
+\r
+/foo.txt\r
+\r
+-1\r
+True\r
+False\r
+False\r
+False\r
+Basic\r
+/foo.txt\r
+/foo.txt\r
+\r
+\r
+\r
+-------------------------\r
+/tmp/hello.txt\r
+file:///tmp/hello.txt\r
+file:///tmp/hello.txt\r
+file\r
+\r
+/tmp/hello.txt\r
+\r
+-1\r
+True\r
+False\r
+False\r
+False\r
+Basic\r
+/tmp/hello.txt\r
+/tmp/hello.txt\r
+\r
+\r
+\r
diff --git a/mcs/class/System/Test/System/test-uri-relative-list.txt b/mcs/class/System/Test/System/test-uri-relative-list.txt
new file mode 100755 (executable)
index 0000000..fe0611b
--- /dev/null
@@ -0,0 +1,95 @@
+server
+server/
+server/maybe_file
+server/directory/
+server.com
+server.com/
+server.com/maybe_file
+server.com/directory/
+# http:server ... should not be allowed
+c:/foo.txt
+c:\foo.txt
+c:/foo.txt
+# /usr/local/bin ... doesn't pass. it is critical problem of MS.NET
+\\server
+# ///server ... this became UNC server name in MS.NET
+server
+server/
+server/maybe_file
+server/directory/
+server.com
+## below should be treated as UNC server
+readme.txt
+server.com/
+# file:server.com
+# file:server.com/
+# file:server
+server.com/maybe_file
+server.com/directory/
+## Below are taken from UriTest.cs
+contoso.com?subject=uri
+mailto:user:pwd@contoso.com?subject=uri
+\\myserver\mydir\mysubdir\myfile.ext
+www.contoso.com
+www.contoso.com/foo/bar/index.html?x=0
+c:\tmp\hello.txt
+# //////cygwin/tmp/hello.txt : it became impossible
+mymachine/cygwin/tmp/hello.txt
+# ///c:/cygwin/tmp/hello.txt
+one_file.txt
+cygwin/tmp/hello.txt
+server/filename.ext
+\\server\share\filename.ext
+1.2.3.4
+1.2.3.4
+# file:
+# http:
+# makefile
+# gopher:
+# ftp:
+# file:/
+# 
+# / ... however, should be allowed in Unix file path.
+# \
+# c:
+# /c: ... however, should be allowed in Windows file path.
+# news: ... in fact MS passes this.
+# Below should be allowed
+localhost/c#
+localhost/c#bookmark
+localhost/c#
+# this passes... it breaks RFC 2396 rule.
+c#
+mailto:c#
+c#bookmark
+#
+# non-standard scheme
+#
+urn:mono-uri-test
+# This "8080" is not a port specifier. This is "opaque part" (RFC 2396)
+urn:mono-uri-test:8080
+# But here, it is interpreted as a host name.
+urn://mono-uri-test:8080
+# Scheme cannot start with non-alphabetic character, but MS fails to reject
+ファイル:myserver/foo.txt
+ファイル://myserver/foo.txt
+辭典://cn_to_ja/
+#
+# still looks TODO (EscapeString)
+#
+web.app.com/test.cgi?value=あいうえお
+辭典:cn_to_ja/ファイル
+ファイル:
+辭典:
+#
+#
+# below should not be allowed but MS passes.
+c:/c#
+#
+#
+# MS.NET supplies no host info (consoto.com), but I think Mono is better.
+# news:123456@contoso.com
+#
+# MS handles it as http, but it is inconsistent with \\server as file.
+# //server
+# //localhost/c#
diff --git a/mcs/class/System/Test/System/test-uri-relative-props.txt b/mcs/class/System/Test/System/test-uri-relative-props.txt
new file mode 100755 (executable)
index 0000000..0bf6c10
--- /dev/null
@@ -0,0 +1,969 @@
+-------------------------\r
+server\r
+http://www.go-mono.com/server\r
+http://www.go-mono.com/server\r
+http\r
+www.go-mono.com\r
+/server\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server\r
+/server\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server/\r
+http://www.go-mono.com/server/\r
+http://www.go-mono.com/server/\r
+http\r
+www.go-mono.com\r
+/server/\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server/\r
+/server/\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server/maybe_file\r
+http://www.go-mono.com/server/maybe_file\r
+http://www.go-mono.com/server/maybe_file\r
+http\r
+www.go-mono.com\r
+/server/maybe_file\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server/maybe_file\r
+/server/maybe_file\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server/directory/\r
+http://www.go-mono.com/server/directory/\r
+http://www.go-mono.com/server/directory/\r
+http\r
+www.go-mono.com\r
+/server/directory/\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server/directory/\r
+/server/directory/\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server.com\r
+http://www.go-mono.com/server.com\r
+http://www.go-mono.com/server.com\r
+http\r
+www.go-mono.com\r
+/server.com\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server.com\r
+/server.com\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server.com/\r
+http://www.go-mono.com/server.com/\r
+http://www.go-mono.com/server.com/\r
+http\r
+www.go-mono.com\r
+/server.com/\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server.com/\r
+/server.com/\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server.com/maybe_file\r
+http://www.go-mono.com/server.com/maybe_file\r
+http://www.go-mono.com/server.com/maybe_file\r
+http\r
+www.go-mono.com\r
+/server.com/maybe_file\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server.com/maybe_file\r
+/server.com/maybe_file\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server.com/directory/\r
+http://www.go-mono.com/server.com/directory/\r
+http://www.go-mono.com/server.com/directory/\r
+http\r
+www.go-mono.com\r
+/server.com/directory/\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server.com/directory/\r
+/server.com/directory/\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+c:/foo.txt\r
+file:///c:/foo.txt\r
+file:///c:/foo.txt\r
+file\r
+\r
+c:\foo.txt\r
+\r
+-1\r
+True\r
+False\r
+False\r
+False\r
+Basic\r
+c:/foo.txt\r
+c:/foo.txt\r
+\r
+\r
+\r
+-------------------------\r
+c:\foo.txt\r
+file:///c:/foo.txt\r
+file:///c:/foo.txt\r
+file\r
+\r
+c:\foo.txt\r
+\r
+-1\r
+True\r
+False\r
+False\r
+False\r
+Basic\r
+c:/foo.txt\r
+c:/foo.txt\r
+\r
+\r
+\r
+-------------------------\r
+c:/foo.txt\r
+file:///c:/foo.txt\r
+file:///c:/foo.txt\r
+file\r
+\r
+c:\foo.txt\r
+\r
+-1\r
+True\r
+False\r
+False\r
+False\r
+Basic\r
+c:/foo.txt\r
+c:/foo.txt\r
+\r
+\r
+\r
+-------------------------\r
+\\server\r
+file://server\r
+file://server\r
+file\r
+server\r
+\\server\r
+\r
+-1\r
+True\r
+True\r
+False\r
+False\r
+Dns\r
+\r
+\r
+server\r
+\r
+\r
+-------------------------\r
+server\r
+http://www.go-mono.com/server\r
+http://www.go-mono.com/server\r
+http\r
+www.go-mono.com\r
+/server\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server\r
+/server\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server/\r
+http://www.go-mono.com/server/\r
+http://www.go-mono.com/server/\r
+http\r
+www.go-mono.com\r
+/server/\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server/\r
+/server/\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server/maybe_file\r
+http://www.go-mono.com/server/maybe_file\r
+http://www.go-mono.com/server/maybe_file\r
+http\r
+www.go-mono.com\r
+/server/maybe_file\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server/maybe_file\r
+/server/maybe_file\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server/directory/\r
+http://www.go-mono.com/server/directory/\r
+http://www.go-mono.com/server/directory/\r
+http\r
+www.go-mono.com\r
+/server/directory/\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server/directory/\r
+/server/directory/\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server.com\r
+http://www.go-mono.com/server.com\r
+http://www.go-mono.com/server.com\r
+http\r
+www.go-mono.com\r
+/server.com\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server.com\r
+/server.com\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+readme.txt\r
+http://www.go-mono.com/readme.txt\r
+http://www.go-mono.com/readme.txt\r
+http\r
+www.go-mono.com\r
+/readme.txt\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/readme.txt\r
+/readme.txt\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server.com/\r
+http://www.go-mono.com/server.com/\r
+http://www.go-mono.com/server.com/\r
+http\r
+www.go-mono.com\r
+/server.com/\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server.com/\r
+/server.com/\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server.com/maybe_file\r
+http://www.go-mono.com/server.com/maybe_file\r
+http://www.go-mono.com/server.com/maybe_file\r
+http\r
+www.go-mono.com\r
+/server.com/maybe_file\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server.com/maybe_file\r
+/server.com/maybe_file\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server.com/directory/\r
+http://www.go-mono.com/server.com/directory/\r
+http://www.go-mono.com/server.com/directory/\r
+http\r
+www.go-mono.com\r
+/server.com/directory/\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server.com/directory/\r
+/server.com/directory/\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+contoso.com?subject=uri\r
+http://www.go-mono.com/contoso.com?subject=uri\r
+http://www.go-mono.com/contoso.com?subject=uri\r
+http\r
+www.go-mono.com\r
+/contoso.com\r
+?subject=uri\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/contoso.com\r
+/contoso.com?subject=uri\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+mailto:user:pwd@contoso.com?subject=uri\r
+mailto:user:pwd@contoso.com?subject=uri\r
+mailto:user:pwd@contoso.com?subject=uri\r
+mailto\r
+contoso.com\r
+\r
+?subject=uri\r
+25\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+\r
+?subject=uri\r
+contoso.com\r
+\r
+user:pwd\r
+-------------------------\r
+\\myserver\mydir\mysubdir\myfile.ext\r
+file://myserver/mydir/mysubdir/myfile.ext\r
+file://myserver/mydir/mysubdir/myfile.ext\r
+file\r
+myserver\r
+\\myserver\mydir\mysubdir\myfile.ext\r
+\r
+-1\r
+True\r
+True\r
+False\r
+False\r
+Dns\r
+/mydir/mysubdir/myfile.ext\r
+/mydir/mysubdir/myfile.ext\r
+myserver\r
+\r
+\r
+-------------------------\r
+www.contoso.com\r
+http://www.go-mono.com/www.contoso.com\r
+http://www.go-mono.com/www.contoso.com\r
+http\r
+www.go-mono.com\r
+/www.contoso.com\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/www.contoso.com\r
+/www.contoso.com\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+www.contoso.com/foo/bar/index.html?x=0\r
+http://www.go-mono.com/www.contoso.com/foo/bar/index.html?x=0\r
+http://www.go-mono.com/www.contoso.com/foo/bar/index.html?x=0\r
+http\r
+www.go-mono.com\r
+/www.contoso.com/foo/bar/index.html\r
+?x=0\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/www.contoso.com/foo/bar/index.html\r
+/www.contoso.com/foo/bar/index.html?x=0\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+c:\tmp\hello.txt\r
+file:///c:/tmp/hello.txt\r
+file:///c:/tmp/hello.txt\r
+file\r
+\r
+c:\tmp\hello.txt\r
+\r
+-1\r
+True\r
+False\r
+False\r
+False\r
+Basic\r
+c:/tmp/hello.txt\r
+c:/tmp/hello.txt\r
+\r
+\r
+\r
+-------------------------\r
+mymachine/cygwin/tmp/hello.txt\r
+http://www.go-mono.com/mymachine/cygwin/tmp/hello.txt\r
+http://www.go-mono.com/mymachine/cygwin/tmp/hello.txt\r
+http\r
+www.go-mono.com\r
+/mymachine/cygwin/tmp/hello.txt\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/mymachine/cygwin/tmp/hello.txt\r
+/mymachine/cygwin/tmp/hello.txt\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+one_file.txt\r
+http://www.go-mono.com/one_file.txt\r
+http://www.go-mono.com/one_file.txt\r
+http\r
+www.go-mono.com\r
+/one_file.txt\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/one_file.txt\r
+/one_file.txt\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+cygwin/tmp/hello.txt\r
+http://www.go-mono.com/cygwin/tmp/hello.txt\r
+http://www.go-mono.com/cygwin/tmp/hello.txt\r
+http\r
+www.go-mono.com\r
+/cygwin/tmp/hello.txt\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/cygwin/tmp/hello.txt\r
+/cygwin/tmp/hello.txt\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+server/filename.ext\r
+http://www.go-mono.com/server/filename.ext\r
+http://www.go-mono.com/server/filename.ext\r
+http\r
+www.go-mono.com\r
+/server/filename.ext\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/server/filename.ext\r
+/server/filename.ext\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+\\server\share\filename.ext\r
+file://server/share/filename.ext\r
+file://server/share/filename.ext\r
+file\r
+server\r
+\\server\share\filename.ext\r
+\r
+-1\r
+True\r
+True\r
+False\r
+False\r
+Dns\r
+/share/filename.ext\r
+/share/filename.ext\r
+server\r
+\r
+\r
+-------------------------\r
+1.2.3.4\r
+http://www.go-mono.com/1.2.3.4\r
+http://www.go-mono.com/1.2.3.4\r
+http\r
+www.go-mono.com\r
+/1.2.3.4\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/1.2.3.4\r
+/1.2.3.4\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+1.2.3.4\r
+http://www.go-mono.com/1.2.3.4\r
+http://www.go-mono.com/1.2.3.4\r
+http\r
+www.go-mono.com\r
+/1.2.3.4\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/1.2.3.4\r
+/1.2.3.4\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+localhost/c#\r
+http://www.go-mono.com/localhost/c#\r
+http://www.go-mono.com/localhost/c#\r
+http\r
+www.go-mono.com\r
+/localhost/c\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/localhost/c\r
+/localhost/c\r
+www.go-mono.com\r
+#\r
+\r
+-------------------------\r
+localhost/c#bookmark\r
+http://www.go-mono.com/localhost/c#bookmark\r
+http://www.go-mono.com/localhost/c#bookmark\r
+http\r
+www.go-mono.com\r
+/localhost/c\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/localhost/c\r
+/localhost/c\r
+www.go-mono.com\r
+#bookmark\r
+\r
+-------------------------\r
+localhost/c#\r
+http://www.go-mono.com/localhost/c#\r
+http://www.go-mono.com/localhost/c#\r
+http\r
+www.go-mono.com\r
+/localhost/c\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/localhost/c\r
+/localhost/c\r
+www.go-mono.com\r
+#\r
+\r
+-------------------------\r
+c#\r
+http://www.go-mono.com/c#\r
+http://www.go-mono.com/c#\r
+http\r
+www.go-mono.com\r
+/c\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/c\r
+/c\r
+www.go-mono.com\r
+#\r
+\r
+-------------------------\r
+mailto:c#\r
+mailto:c#\r
+mailto:c#\r
+mailto\r
+c\r
+\r
+\r
+25\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+\r
+\r
+c\r
+#\r
+\r
+-------------------------\r
+c#bookmark\r
+http://www.go-mono.com/c#bookmark\r
+http://www.go-mono.com/c#bookmark\r
+http\r
+www.go-mono.com\r
+/c\r
+\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/c\r
+/c\r
+www.go-mono.com\r
+#bookmark\r
+\r
+-------------------------\r
+urn:mono-uri-test\r
+urn:mono-uri-test\r
+urn:mono-uri-test\r
+urn\r
+\r
+mono-uri-test\r
+\r
+-1\r
+False\r
+False\r
+False\r
+False\r
+Basic\r
+mono-uri-test\r
+mono-uri-test\r
+\r
+\r
+\r
+-------------------------\r
+urn:mono-uri-test:8080\r
+urn:mono-uri-test:8080\r
+urn:mono-uri-test:8080\r
+urn\r
+\r
+mono-uri-test:8080\r
+\r
+-1\r
+False\r
+False\r
+False\r
+False\r
+Basic\r
+mono-uri-test:8080\r
+mono-uri-test:8080\r
+\r
+\r
+\r
+-------------------------\r
+urn://mono-uri-test:8080\r
+urn://mono-uri-test:8080/\r
+urn://mono-uri-test:8080/\r
+urn\r
+mono-uri-test\r
+/\r
+\r
+8080\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/\r
+/\r
+mono-uri-test:8080\r
+\r
+\r
+-------------------------\r
+ファイル:myserver/foo.txt\r
+ファイル:myserver/foo.txt\r
+ファイル:myserver/foo.txt\r
+ファイル\r
+\r
+myserver/foo.txt\r
+\r
+-1\r
+False\r
+False\r
+False\r
+False\r
+Basic\r
+myserver/foo.txt\r
+myserver/foo.txt\r
+\r
+\r
+\r
+-------------------------\r
+ファイル://myserver/foo.txt\r
+ファイル://myserver/foo.txt\r
+ファイル://myserver/foo.txt\r
+ファイル\r
+myserver\r
+/foo.txt\r
+\r
+-1\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/foo.txt\r
+/foo.txt\r
+myserver\r
+\r
+\r
+-------------------------\r
+辭典://cn_to_ja/\r
+辭典://cn_to_ja/\r
+辭典://cn_to_ja/\r
+辭典\r
+cn_to_ja\r
+/\r
+\r
+-1\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/\r
+/\r
+cn_to_ja\r
+\r
+\r
+-------------------------\r
+web.app.com/test.cgi?value=あいうえお\r
+http://www.go-mono.com/web.app.com/test.cgi?value=あいうえお\r
+http://www.go-mono.com/web.app.com/test.cgi?value=%E3%81%82%E3%81%84%E3%81%86%E3%81%88%E3%81%8A\r
+http\r
+www.go-mono.com\r
+/web.app.com/test.cgi\r
+?value=%E3%81%82%E3%81%84%E3%81%86%E3%81%88%E3%81%8A\r
+80\r
+False\r
+False\r
+False\r
+False\r
+Dns\r
+/web.app.com/test.cgi\r
+/web.app.com/test.cgi?value=%E3%81%82%E3%81%84%E3%81%86%E3%81%88%E3%81%8A\r
+www.go-mono.com\r
+\r
+\r
+-------------------------\r
+辭典:cn_to_ja/ファイル\r
+辭典:cn_to_ja/ファイル\r
+辭典:cn_to_ja/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB\r
+辭典\r
+\r
+cn_to_ja/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB\r
+\r
+-1\r
+False\r
+False\r
+False\r
+False\r
+Basic\r
+cn_to_ja/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB\r
+cn_to_ja/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB\r
+\r
+\r
+\r
+-------------------------\r
+ファイル:\r
+ファイル:\r
+ファイル:\r
+ファイル\r
+\r
+\r
+\r
+-1\r
+False\r
+False\r
+False\r
+False\r
+Basic\r
+\r
+\r
+\r
+\r
+\r
+-------------------------\r
+辭典:\r
+辭典:\r
+辭典:\r
+辭典\r
+\r
+\r
+\r
+-1\r
+False\r
+False\r
+False\r
+False\r
+Basic\r
+\r
+\r
+\r
+\r
+\r
+-------------------------\r
+c:/c#\r
+file:///c:/c%23\r
+file:///c:/c%23\r
+file\r
+\r
+c:\c#\r
+\r
+-1\r
+True\r
+False\r
+False\r
+False\r
+Basic\r
+c:/c%23\r
+c:/c%23\r
+\r
+\r
+\r
index 2de5e74d575d7a5c569ab16619a29b911094f2ba..79f26d273eccbec7d00b8e06d235e6176e8cc86f 100755 (executable)
 using System;\r
 using System.IO;\r
 using System.Text;\r
-using NUnit.Framework;\r
 \r
 namespace MonoTests.System\r
 {\r
-       [TestFixture]\r
        public class UriTestGenerator\r
        {\r
                public static void Main (string [] args)\r
@@ -24,6 +22,12 @@ namespace MonoTests.System
                        StreamWriter sw = new StreamWriter ("test-uri-props.txt", false, Encoding.UTF8);\r
 \r
                        GenerateResult (sr, sw, null);\r
+\r
+                       sr = new StreamReader ("test-uri-relative-list.txt", Encoding.UTF8);\r
+                       sw = new StreamWriter ("test-uri-relative-props.txt", false, Encoding.UTF8);\r
+\r
+                       Uri baseUri = new Uri ("http://www.go-mono.com");\r
+                       GenerateResult (sr, sw, baseUri);\r
                }\r
 \r
                public static void GenerateResult (TextReader sr, TextWriter sw, Uri baseUri)\r
@@ -54,6 +58,7 @@ namespace MonoTests.System
                                sw.WriteLine (uri.Authority);\r
                                sw.WriteLine (uri.Fragment);\r
                                sw.WriteLine (uri.UserInfo);\r
+                               sw.Flush ();\r
                        }\r
                        sr.Close ();\r
                        sw.Close ();\r