Skip to content

Commit

Permalink
Update the trimming test
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekgh committed Jun 30, 2021
1 parent c89f557 commit 7aabf49
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,14 @@ static int Main(string[] args)
// Ensure the internal GlobalizationMode class is trimmed correctly
Type globalizationMode = GetCoreLibType("System.Globalization.GlobalizationMode");
const BindingFlags allStatics = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
bool predefinedCulturesOnly = (bool) globalizationMode.GetProperty("PredefinedCulturesOnly", allStatics).GetValue(null);

try
{
CultureInfo.CurrentCulture = new CultureInfo("tr-TR");
if (predefinedCulturesOnly)
{
return -1; // we expect new CultureInfo("tr-TR") to throw.
}
return -1; // we expect new CultureInfo("tr-TR") to throw.
}
catch (CultureNotFoundException)
{
if (!predefinedCulturesOnly)
{
return -2; // It is not expected to have new CultureInfo("tr-TR") to throw.
}
}

if ("i".ToUpper() != "I")
Expand Down

0 comments on commit 7aabf49

Please sign in to comment.