From 8c503e116ad0305060de8c227e21ee7c255cf310 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Wed, 30 Jun 2021 18:17:30 -0700 Subject: [PATCH] Fix the browser AOT tests --- .../Wasm.Build.Tests/InvariantGlobalizationTests.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/InvariantGlobalizationTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/InvariantGlobalizationTests.cs index 753f8c40c2af7..6b53bc1c0b68a 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/InvariantGlobalizationTests.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/InvariantGlobalizationTests.cs @@ -62,9 +62,17 @@ private void TestInvariantGlobalization(BuildArgs buildArgs, bool? invariantGlob public class TestClass { public static int Main() { - var culture = new CultureInfo(""es-ES"", false); + CultureInfo culture; + try + { + culture = new CultureInfo(""es-ES"", false); // https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md#cultures-and-culture-data - Console.WriteLine($""{culture.LCID == 0x1000} - {culture.NativeName}""); + } + catch + { + culture = new CultureInfo("""", false); + } + Console.WriteLine($""{culture.LCID == CultureInfo.InvariantCulture.LCID} - {culture.NativeName}""); return 42; } }";