You've already forked linux-packaging-mono
Imported Upstream version 5.10.0.47
Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
parent
88ff76fe28
commit
e46a49ecf1
@@ -410,8 +410,9 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
SortVersion sv1 = CultureInfo.GetCultureInfo("en-US").CompareInfo.Version;
|
||||
SortVersion sv2 = CultureInfo.GetCultureInfo("ja-JP").CompareInfo.Version;
|
||||
SortVersion sv3 = CultureInfo.GetCultureInfo("en").CompareInfo.Version;
|
||||
|
||||
Assert.Equal(sv1.FullVersion, sv2.FullVersion);
|
||||
Assert.Equal(sv1.FullVersion, sv3.FullVersion);
|
||||
Assert.NotEqual(sv1.SortId, sv2.SortId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace System.Globalization.Tests
|
||||
[Fact]
|
||||
public void CurrentCulture()
|
||||
{
|
||||
if (PlatformDetection.IsNetNative && !PlatformDetection.IsWinRT) // Tide us over until .Net Native ILC tests run are run inside an appcontainer.
|
||||
if (PlatformDetection.IsNetNative && !PlatformDetection.IsInAppContainer) // Tide us over until .Net Native ILC tests run are run inside an appcontainer.
|
||||
return;
|
||||
|
||||
RemoteInvoke(() =>
|
||||
@@ -43,7 +43,7 @@ namespace System.Globalization.Tests
|
||||
[Fact]
|
||||
public void CurrentUICulture()
|
||||
{
|
||||
if (PlatformDetection.IsNetNative && !PlatformDetection.IsWinRT) // Tide us over until .Net Native ILC tests run are run inside an appcontainer.
|
||||
if (PlatformDetection.IsNetNative && !PlatformDetection.IsInAppContainer) // Tide us over until .Net Native ILC tests run are run inside an appcontainer.
|
||||
return;
|
||||
|
||||
RemoteInvoke(() =>
|
||||
|
||||
@@ -35,9 +35,6 @@ namespace System.Globalization.Tests
|
||||
[Fact]
|
||||
public void TestSettingThreadCultures()
|
||||
{
|
||||
if (PlatformDetection.IsNetNative && !PlatformDetection.IsWinRT) // Tide us over until .Net Native ILC tests run are run inside an appcontainer.
|
||||
return;
|
||||
|
||||
RemoteInvoke(() =>
|
||||
{
|
||||
CultureInfo culture = new CultureInfo("ja-JP");
|
||||
|
||||
@@ -13,8 +13,8 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> CurrencyDecimalDigits_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo, 2, 2 };
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat, 2, 2 };
|
||||
yield return new object[] { new CultureInfo("ko").NumberFormat, 0, 2 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, 2, 2 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("ko").NumberFormat, 0, 2 };
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -12,12 +12,12 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> CurrencyGroupSizes_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo, new int[] { 3 } };
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat, new int[] { 3 } };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, new int[] { 3 } };
|
||||
|
||||
if ((!PlatformDetection.IsUbuntu || PlatformDetection.IsUbuntu1404)
|
||||
&& !PlatformDetection.IsWindows7 && !PlatformDetection.IsWindows8x && !PlatformDetection.IsFedora)
|
||||
{
|
||||
yield return new object[] { new CultureInfo("ur-IN").NumberFormat, new int[] { 3, 2 } };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("ur-IN").NumberFormat, new int[] { 3, 2 } };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> CurrencyNegativePattern_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo, new int[] { 0 } };
|
||||
yield return new object[] { new CultureInfo("bg-BG").NumberFormat, new int[] { 8 } };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("bg-BG").NumberFormat, new int[] { 8 } };
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -36,7 +36,7 @@ namespace System.Globalization.Tests
|
||||
CultureInfo culture;
|
||||
try
|
||||
{
|
||||
culture = new CultureInfo(locale);
|
||||
culture = CultureInfo.GetCultureInfo(locale);
|
||||
}
|
||||
catch(CultureNotFoundException)
|
||||
{
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> CurrencyPositivePattern_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo, 0 };
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat, 0 };
|
||||
yield return new object[] { new CultureInfo("fr-FR").NumberFormat, 3 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, 0 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("fr-FR").NumberFormat, 3 };
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace System.Globalization.Tests
|
||||
[InlineData("", "\x00a4")] // international
|
||||
public void CurrencySymbol_Get(string name, string expected)
|
||||
{
|
||||
Assert.Equal(expected, new CultureInfo(name).NumberFormat.CurrencySymbol);
|
||||
Assert.Equal(expected, CultureInfo.GetCultureInfo(name).NumberFormat.CurrencySymbol);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
public static IEnumerable<object[]> CurrentInfo_CustomCulture_TestData()
|
||||
{
|
||||
yield return new object[] { new CultureInfo("en") };
|
||||
yield return new object[] { new CultureInfo("en-US") };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en") };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US") };
|
||||
yield return new object[] { CultureInfo.InvariantCulture };
|
||||
}
|
||||
|
||||
@@ -21,12 +21,9 @@ namespace System.Globalization.Tests
|
||||
[MemberData(nameof(CurrentInfo_CustomCulture_TestData))]
|
||||
public void CurrentInfo_CustomCulture(CultureInfo newCurrentCulture)
|
||||
{
|
||||
if (PlatformDetection.IsNetNative && !PlatformDetection.IsWinRT) // Tide us over until .Net Native ILC tests run are run inside an appcontainer.
|
||||
return;
|
||||
|
||||
RemoteInvoke((cultureName) =>
|
||||
{
|
||||
CultureInfo newCulture = new CultureInfo(cultureName);
|
||||
CultureInfo newCulture = CultureInfo.GetCultureInfo(cultureName);
|
||||
CultureInfo.CurrentCulture = newCulture;
|
||||
Assert.Same(newCulture.NumberFormat, NumberFormatInfo.CurrentInfo);
|
||||
return SuccessExitCode;
|
||||
@@ -36,9 +33,6 @@ namespace System.Globalization.Tests
|
||||
[Fact]
|
||||
public void CurrentInfo_Subclass_OverridesGetFormat()
|
||||
{
|
||||
if (PlatformDetection.IsNetNative && !PlatformDetection.IsWinRT) // Tide us over until .Net Native ILC tests run are run inside an appcontainer.
|
||||
return;
|
||||
|
||||
RemoteInvoke(() =>
|
||||
{
|
||||
CultureInfo.CurrentCulture = new CultureInfoSubclassOverridesGetFormat("en-US");
|
||||
@@ -50,9 +44,6 @@ namespace System.Globalization.Tests
|
||||
[Fact]
|
||||
public void CurrentInfo_Subclass_OverridesNumberFormat()
|
||||
{
|
||||
if (PlatformDetection.IsNetNative && !PlatformDetection.IsWinRT) // Tide us over until .Net Native ILC tests run are run inside an appcontainer.
|
||||
return;
|
||||
|
||||
RemoteInvoke(() =>
|
||||
{
|
||||
CultureInfo.CurrentCulture = new CultureInfoSubclassOverridesNumberFormat("en-US");
|
||||
@@ -65,7 +56,7 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
public CultureInfoSubclassOverridesGetFormat(string name): base(name) { }
|
||||
|
||||
public static NumberFormatInfo CustomFormat { get; } = new CultureInfo("fr-FR").NumberFormat;
|
||||
public static NumberFormatInfo CustomFormat { get; } = CultureInfo.GetCultureInfo("fr-FR").NumberFormat;
|
||||
|
||||
public override object GetFormat(Type formatType) => CustomFormat;
|
||||
}
|
||||
@@ -74,7 +65,7 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
public CultureInfoSubclassOverridesNumberFormat(string name): base(name) { }
|
||||
|
||||
public static NumberFormatInfo CustomFormat { get; } = new CultureInfo("fr-FR").NumberFormat;
|
||||
public static NumberFormatInfo CustomFormat { get; } = CultureInfo.GetCultureInfo("fr-FR").NumberFormat;
|
||||
|
||||
public override NumberFormatInfo NumberFormat
|
||||
{
|
||||
|
||||
@@ -8,17 +8,7 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
public static int[] UrINNumberGroupSizes()
|
||||
{
|
||||
if (
|
||||
(PlatformDetection.IsWindows && PlatformDetection.WindowsVersion >= 10)
|
||||
#if !uap
|
||||
||
|
||||
(PlatformDetection.IsOSX && PlatformDetection.OSXKernelVersion >= new Version(15, 0))
|
||||
#endif
|
||||
|| (PlatformDetection.IsUbuntu && !PlatformDetection.IsUbuntu1404)
|
||||
|| PlatformDetection.IsFedora
|
||||
|| (PlatformDetection.IsDebian && !PlatformDetection.IsDebian8)
|
||||
|| PlatformDetection.IsTizen
|
||||
)
|
||||
if (PlatformDetection.WindowsVersion >= 10 || PlatformDetection.ICUVersion.Major >= 55)
|
||||
{
|
||||
return new int[] { 3 };
|
||||
}
|
||||
@@ -49,6 +39,10 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
return (PlatformDetection.WindowsVersion < 10) ? new int[] { 3 } : new int[] { 6, 3 };
|
||||
}
|
||||
if (PlatformDetection.ICUVersion.Major >= 59)
|
||||
{
|
||||
return new int[] { 8 };
|
||||
}
|
||||
else
|
||||
{
|
||||
return new int[] { 1, 0 };
|
||||
@@ -74,7 +68,7 @@ namespace System.Globalization.Tests
|
||||
return PlatformDetection.IsWindows ? new int[] { 15 } : new int[] { 8, 15 };
|
||||
}
|
||||
|
||||
throw DateTimeFormatInfoData.GetCultureNotSupportedException(new CultureInfo(localeName));
|
||||
throw DateTimeFormatInfoData.GetCultureNotSupportedException(CultureInfo.GetCultureInfo(localeName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
public static IEnumerable<object[]> GetInstance_TestData()
|
||||
{
|
||||
CultureInfo frFRCulture = new CultureInfo("fr-FR");
|
||||
CultureInfo frFRCulture = CultureInfo.GetCultureInfo("fr-FR");
|
||||
yield return new object[] { frFRCulture, frFRCulture.NumberFormat };
|
||||
yield return new object[] { frFRCulture.NumberFormat, frFRCulture.NumberFormat };
|
||||
yield return new object[] { new CustomFormatProvider(), CustomFormatProvider.CustomFormat };
|
||||
@@ -55,7 +55,7 @@ namespace System.Globalization.Tests
|
||||
|
||||
private class CustomFormatProvider : IFormatProvider
|
||||
{
|
||||
public static NumberFormatInfo CustomFormat { get; } = new CultureInfo("fr-FR").NumberFormat;
|
||||
public static NumberFormatInfo CustomFormat { get; } = CultureInfo.GetCultureInfo("fr-FR").NumberFormat;
|
||||
|
||||
public object GetFormat(Type formatType) => CustomFormat;
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> NegativeInfinitySymbol_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo };
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat };
|
||||
yield return new object[] { new CultureInfo("fr-FR").NumberFormat };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("fr-FR").NumberFormat };
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> NegativeSign_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo, "-" };
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat, "-" };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, "-" };
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> NumberDecimalDigits_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo, 2, 2 };
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat, 2, 3 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, 2, 3 };
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -12,12 +12,12 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> NumberGroupSizes_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo, new int[] { 3 } };
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat, new int[] { 3 } };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, new int[] { 3 } };
|
||||
|
||||
// Culture does not exist on Windows 7
|
||||
if (!PlatformDetection.IsWindows7)
|
||||
{
|
||||
yield return new object[] { new CultureInfo("ur-IN").NumberFormat, NumberFormatInfoData.UrINNumberGroupSizes() };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("ur-IN").NumberFormat, NumberFormatInfoData.UrINNumberGroupSizes() };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> NumberNegativePattern_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo, 1 };
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat, 1 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, 1 };
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> PercentGroupSizes_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo, new int[] { 3 } };
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat, new int[] { 3 } };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, new int[] { 3 } };
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
public static IEnumerable<object[]> PercentNegativePattern_TestData()
|
||||
{
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat, 1 };
|
||||
yield return new object[] { new CultureInfo("en-MY").NumberFormat, 1 };
|
||||
yield return new object[] { new CultureInfo("tr").NumberFormat, 2 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, 1 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-MY").NumberFormat, 1 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("tr").NumberFormat, 2 };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
public static IEnumerable<object[]> PercentPositivePattern_TestData()
|
||||
{
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat, 1 };
|
||||
yield return new object[] { new CultureInfo("en-MY").NumberFormat, 1 };
|
||||
yield return new object[] { new CultureInfo("tr").NumberFormat, 2 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, 1 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-MY").NumberFormat, 1 };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("tr").NumberFormat, 2 };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> PercentSymbol_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo, "%" };
|
||||
yield return new object[] { new CultureInfo("en-US").NumberFormat, "%" };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, "%" };
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user