2004-06-11 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Fri, 11 Jun 2004 16:18:09 +0000 (16:18 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Fri, 11 Jun 2004 16:18:09 +0000 (16:18 -0000)
* UriTest.cs : Added UnixLocalPath().

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

mcs/class/System/Test/System/ChangeLog
mcs/class/System/Test/System/UriTest.cs

index 2a7ae9e8473668a931dcc8621a81e7e2bebf2454..900a596660921518cfd45511d0e0263cb5dc2149 100644 (file)
@@ -1,3 +1,7 @@
+2004-06-11  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * UriTest.cs : Added UnixLocalPath().
+
 2004-06-11  Atsushi Enomoto  <atsushi@ximian.com>
 
        * UriTest.cs : Added InvalidScheme().
index a6b0b0abb4d51d7832352914d74038f847444c87..47a45c9e7af4947c969932e2cfbe5123a71fa345 100644 (file)
@@ -787,6 +787,24 @@ namespace MonoTests.System
                        UriEx2 ex = new UriEx2 ("readme.txt");
                }
 
+               [Test]
+               public void UnixLocalPath ()
+               {
+                       // This works--the location is not part of the absolute path
+                       string path = "file://localhost/tmp/foo/bar";
+                       Uri fileUri = new Uri( path );
+                       AssertEquals (path, "/tmp/foo/bar", fileUri.AbsolutePath);
+
+                       // Empty path == localhost, in theory
+                       path = "file:///tmp/foo/bar";
+                       fileUri = new Uri( path );
+                       AssertEquals (path, "/tmp/foo/bar", fileUri.AbsolutePath);
+
+                       // Empty path == localhost, in theory
+                       path = "file:///c:/tmp/foo/bar";
+                       fileUri = new Uri( path );
+                       AssertEquals (path, "c:/tmp/foo/bar", fileUri.AbsolutePath);
+               }
 
                public static void Print (Uri uri)
                {