diff --git a/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Utilities.cs b/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Utilities.cs index bc2d55bffb08dd..e596d551a45db8 100644 --- a/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Utilities.cs +++ b/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Utilities.cs @@ -73,6 +73,7 @@ public static bool Verbose // Windows 10 October 2018 Update public static bool IsWindows10Version1809OrGreater => IsWindows && GetWindowsVersion() == 10 && GetWindowsMinorVersion() == 0 && GetWindowsBuildNumber() >= 17763; + public static bool IsWindowsIoTCore { get diff --git a/src/coreclr/tests/src/Regressions/coreclr/0570/Test570.csproj b/src/coreclr/tests/src/Regressions/coreclr/0570/Test570.csproj deleted file mode 100644 index 80fe7cd837af36..00000000000000 --- a/src/coreclr/tests/src/Regressions/coreclr/0570/Test570.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - Exe - true - BuildAndRun - 1 - - - - - - - - diff --git a/src/coreclr/tests/src/Regressions/coreclr/0570/test570.cs b/src/coreclr/tests/src/Regressions/coreclr/0570/test570.cs deleted file mode 100644 index ce572f0a319f9b..00000000000000 --- a/src/coreclr/tests/src/Regressions/coreclr/0570/test570.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -using System; -using System.Globalization; - -public class Test570 -{ - public static int Main() - { - int retVal = 100; - int numDigits = 2; - if (!TestLibrary.Utilities.IsWindows) - { - numDigits = 3; - } - - try - { - CultureInfo enUS = new CultureInfo("en-US"); - TestLibrary.Logging.WriteLine("enUS.NumberFormat.NumberDecimalDigits=" + enUS.NumberFormat.NumberDecimalDigits.ToString()); - if (enUS.NumberFormat.NumberDecimalDigits != numDigits) - { - TestLibrary.Logging.WriteLine("Error: enUS.NumberFormat.NumberDecimalDigits=" + enUS.NumberFormat.NumberDecimalDigits.ToString() + ", expected " + numDigits.ToString()); - retVal = 0; - } - TestLibrary.Logging.WriteLine("enUS.NumberFormat.PercentDecimalDigits=" + enUS.NumberFormat.PercentDecimalDigits.ToString()); - if (enUS.NumberFormat.PercentDecimalDigits != numDigits) - { - TestLibrary.Logging.WriteLine("Error: enUS.NumberFormat.PercentDecimalDigits=" + enUS.NumberFormat.PercentDecimalDigits.ToString() + ", expected " + numDigits.ToString()); - retVal = 0; - } - } - catch (Exception ex) - { - TestLibrary.Logging.WriteLine("Exception cought in main:"+ex.Message); - retVal = 0; - } - return retVal; - } - -} diff --git a/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPercentDecimalDigits.cs b/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPercentDecimalDigits.cs index 30741388ba8426..8bbe772d6a22e3 100644 --- a/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPercentDecimalDigits.cs +++ b/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPercentDecimalDigits.cs @@ -2,16 +2,25 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Collections.Generic; using Xunit; namespace System.Globalization.Tests { public class NumberFormatInfoPercentDecimalDigits { - [Fact] - public void PercentDecimalDigits_GetInvariantInfo_ReturnsExpected() + public static IEnumerable PercentDecimalDigits_TestData() + { + yield return new object[] { NumberFormatInfo.InvariantInfo, 2, 2 }; + yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, 2, 3 }; + } + + [Theory] + [MemberData(nameof(PercentDecimalDigits_TestData))] + public void PercentDecimalDigits_Get_ReturnsExpected(NumberFormatInfo format, int expectedNls, int expectedIcu) { - Assert.Equal(2, NumberFormatInfo.InvariantInfo.PercentDecimalDigits); + int expected = PlatformDetection.IsNlsGlobalization ? expectedNls : expectedIcu; + Assert.Equal(expected, format.PercentDecimalDigits); } [Theory]