Skip to content

Commit

Permalink
Fix coreclr Test570 due to ICU on Windows feature (dotnet#35435)
Browse files Browse the repository at this point in the history
* Remove test and add testcase to PercentDecimalDigits tests
  • Loading branch information
safern authored Apr 25, 2020
1 parent ab7ef9b commit 1db71ea
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions src/coreclr/tests/src/Regressions/coreclr/0570/Test570.csproj

This file was deleted.

42 changes: 0 additions & 42 deletions src/coreclr/tests/src/Regressions/coreclr/0570/test570.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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<object[]> 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]
Expand Down

0 comments on commit 1db71ea

Please sign in to comment.