X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FTest%2FSystem%2FUriTest.cs;h=beebf4dfc5b1b547974c42da95cc52ce84ca7126;hb=bd52e33266aee6ffbddf313a99db7fffc497a095;hp=1a261938e9c27227948d0bc9d15cb95daf461bbb;hpb=2775839f66faf67803efd96af7aa075888a1e09b;p=mono.git diff --git a/mcs/class/System/Test/System/UriTest.cs b/mcs/class/System/Test/System/UriTest.cs index 1a261938e9c..beebf4dfc5b 100644 --- a/mcs/class/System/Test/System/UriTest.cs +++ b/mcs/class/System/Test/System/UriTest.cs @@ -1914,6 +1914,20 @@ namespace MonoTests.System Assert.AreEqual ("id=1%262&sort=asc", escaped, "UriEscaped"); } + // When used, paths such as "/foo" are assumed relative. + static UriKind DotNetRelativeOrAbsolute = (Type.GetType ("Mono.Runtime") == null)? UriKind.RelativeOrAbsolute : (UriKind) 300; + + [Test] + public void DotNetRelativeOrAbsoluteTest () + { + var uri1 = new Uri ("/foo", DotNetRelativeOrAbsolute); + Assert.IsFalse (uri1.IsAbsoluteUri); + + Uri uri2; + Uri.TryCreate("/foo", DotNetRelativeOrAbsolute, out uri2); + Assert.IsFalse (uri2.IsAbsoluteUri); + } + [Test] // Bug #12631 public void LocalPathWithBaseUrl ()