Imported Upstream version 5.16.0.100

Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-08-07 15:19:03 +00:00
parent 0a9828183b
commit 7d7f676260
4419 changed files with 170950 additions and 90273 deletions

View File

@@ -540,5 +540,32 @@ namespace System.PrivateUri.Tests
Assert.Equal(authority, fileTwoSlashes.Authority); // Two slashes must be followed by an authority
Assert.Equal(authority, fileFourSlashes.Authority); // More than three slashes looks like a UNC share
}
[Theory]
[InlineData(@"c:/path/with/unicode/ö/test.xml")]
[InlineData(@"file://c:/path/with/unicode/ö/test.xml")]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Requires fix shipping in .NET 4.7.2")]
public void Iri_WindowsPathWithUnicode_DoesRemoveScheme(string uriString)
{
var uri = new Uri(uriString);
Assert.False(uri.LocalPath.StartsWith("file:"));
}
[Theory]
[InlineData("http:%C3%A8")]
[InlineData("http:\u00E8")]
[InlineData("%C3%A8")]
[InlineData("\u00E8")]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Requires fix shipping in .NET 4.7.2")]
public void Iri_RelativeUriCreation_ShouldNotNormalize(string uriString)
{
Uri href;
Uri hrefAbsolute;
Uri baseIri = new Uri("http://www.contoso.com");
Assert.True(Uri.TryCreate(uriString, UriKind.RelativeOrAbsolute, out href));
Assert.True(Uri.TryCreate(baseIri, href, out hrefAbsolute));
Assert.Equal("http://www.contoso.com/%C3%A8", hrefAbsolute.AbsoluteUri);
}
}
}