You've already forked linux-packaging-mono
Imported Upstream version 4.2.1.36
Former-commit-id: f3008ca867fe7e4b7ae9b9a8844c0ad5798925a9
This commit is contained in:
committed by
Jo Shields
parent
afe402035c
commit
ea5caba957
@@ -387,6 +387,13 @@ namespace MonoTests.System
|
||||
// this is what ASP.NET really means (the ?)
|
||||
Assert.AreEqual ("http://192.168.0.21/error404.aspx?aspxerrorpath=/WebResource.axd", ub.Uri.ToString ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void NoHostname ()
|
||||
{
|
||||
UriBuilder ub = new UriBuilder ("about", null, -1, "config");
|
||||
Assert.AreEqual ("about:config", ub.ToString ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1946,12 +1946,44 @@ namespace MonoTests.System
|
||||
[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);
|
||||
FieldInfo useDotNetRelativeOrAbsoluteField = null;
|
||||
bool useDotNetRelativeOrAbsoluteOld = false;
|
||||
|
||||
if (Type.GetType ("Mono.Runtime") != null) {
|
||||
useDotNetRelativeOrAbsoluteField = typeof (Uri).GetField ("useDotNetRelativeOrAbsolute",
|
||||
BindingFlags.Static | BindingFlags.GetField | BindingFlags.NonPublic);
|
||||
useDotNetRelativeOrAbsoluteOld = (bool) useDotNetRelativeOrAbsoluteField.GetValue (null);
|
||||
useDotNetRelativeOrAbsoluteField.SetValue (null, false);
|
||||
}
|
||||
|
||||
try {
|
||||
Uri uri;
|
||||
|
||||
uri = new Uri ("/foo", DotNetRelativeOrAbsolute);
|
||||
Assert.IsFalse (uri.IsAbsoluteUri);
|
||||
|
||||
Uri.TryCreate("/foo", DotNetRelativeOrAbsolute, out uri);
|
||||
Assert.IsFalse (uri.IsAbsoluteUri);
|
||||
|
||||
if (useDotNetRelativeOrAbsoluteField != null) {
|
||||
uri = new Uri ("/foo", UriKind.RelativeOrAbsolute);
|
||||
Assert.IsTrue (uri.IsAbsoluteUri);
|
||||
|
||||
Uri.TryCreate("/foo", UriKind.RelativeOrAbsolute, out uri);
|
||||
Assert.IsTrue (uri.IsAbsoluteUri);
|
||||
|
||||
useDotNetRelativeOrAbsoluteField.SetValue (null, true);
|
||||
}
|
||||
|
||||
uri = new Uri ("/foo", UriKind.RelativeOrAbsolute);
|
||||
Assert.IsFalse (uri.IsAbsoluteUri);
|
||||
|
||||
Uri.TryCreate("/foo", DotNetRelativeOrAbsolute, out uri);
|
||||
Assert.IsFalse (uri.IsAbsoluteUri);
|
||||
} finally {
|
||||
if (useDotNetRelativeOrAbsoluteField != null)
|
||||
useDotNetRelativeOrAbsoluteField.SetValue (null, useDotNetRelativeOrAbsoluteOld);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
Reference in New Issue
Block a user