Author: robertj
Date: 2008-01-26 08:42:01 -0500 (Sat, 26 Jan 2008)
New Revision: 93984

Modified:
   trunk/mcs/class/System/System/ChangeLog
   trunk/mcs/class/System/System/Uri.cs
   trunk/mcs/class/System/Test/System/ChangeLog
   trunk/mcs/class/System/Test/System/UriTest3.cs
Log:
In Test/System:
2008-01-23  Robert Jordan  <[EMAIL PROTECTED]>

        * UriTest3.cs: Add tests for bug #346432.

In System:
2008-01-23  Robert Jordan  <[EMAIL PROTECTED]>

        * Uri.cs (Parse): Handle uriString.Length == 1 as a valid relative URI.
        Fixes #346432.



Modified: trunk/mcs/class/System/System/ChangeLog
===================================================================
--- trunk/mcs/class/System/System/ChangeLog     2008-01-26 12:44:02 UTC (rev 
93983)
+++ trunk/mcs/class/System/System/ChangeLog     2008-01-26 13:42:01 UTC (rev 
93984)
@@ -1,3 +1,8 @@
+2008-01-23  Robert Jordan  <[EMAIL PROTECTED]>
+
+       * Uri.cs (Parse): Handle uriString.Length == 1 as a valid relative URI.
+       Fixes #346432.
+
 2007-12-04  Arina Itkes <[EMAIL PROTECTED]>
 
        * Uri.cs: Unix absolute path should not be valid on Windows.

Modified: trunk/mcs/class/System/System/Uri.cs
===================================================================
--- trunk/mcs/class/System/System/Uri.cs        2008-01-26 12:44:02 UTC (rev 
93983)
+++ trunk/mcs/class/System/System/Uri.cs        2008-01-26 13:42:01 UTC (rev 
93984)
@@ -1272,7 +1272,7 @@
                                }
                        }
                        
-                       if (len <= 1) 
+                       if (len <= 1 && (kind != UriKind.Relative))
                                throw new UriFormatException ();
 
                        int pos = 0;

Modified: trunk/mcs/class/System/Test/System/ChangeLog
===================================================================
--- trunk/mcs/class/System/Test/System/ChangeLog        2008-01-26 12:44:02 UTC 
(rev 93983)
+++ trunk/mcs/class/System/Test/System/ChangeLog        2008-01-26 13:42:01 UTC 
(rev 93984)
@@ -1,3 +1,7 @@
+2008-01-23  Robert Jordan  <[EMAIL PROTECTED]>
+
+       * UriTest3.cs: Add tests for bug #346432.
+
 2007-11-06  Gert Driesen  <[EMAIL PROTECTED]>
 
        * UriBuilderTest.cs: Added tests for regression introduced as part of

Modified: trunk/mcs/class/System/Test/System/UriTest3.cs
===================================================================
--- trunk/mcs/class/System/Test/System/UriTest3.cs      2008-01-26 12:44:02 UTC 
(rev 93983)
+++ trunk/mcs/class/System/Test/System/UriTest3.cs      2008-01-26 13:42:01 UTC 
(rev 93984)
@@ -95,6 +95,18 @@
                        Assert.AreEqual ("/test.aspx", uri.OriginalString, 
"#D2");
                        Assert.AreEqual ("/test.aspx", uri.ToString (), "#D3");
                        Assert.IsFalse (uri.UserEscaped, "#D4");
+
+                       uri = new Uri ("", UriKind.Relative);
+                       Assert.IsFalse (uri.IsAbsoluteUri, "#E1");
+                       Assert.AreEqual ("", uri.OriginalString, "#E2");
+                       Assert.AreEqual ("", uri.ToString (), "#E3");
+                       Assert.IsFalse (uri.UserEscaped, "#E4");
+
+                       uri = new Uri ("a", UriKind.Relative);
+                       Assert.IsFalse (uri.IsAbsoluteUri, "#F1");
+                       Assert.AreEqual ("a", uri.OriginalString, "#F2");
+                       Assert.AreEqual ("a", uri.ToString (), "#F3");
+                       Assert.IsFalse (uri.UserEscaped, "#F4");
                }
 
                [Test]

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to