From 861119c5e0b8fbf7fb3f45edfdb30117da256809 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Mon, 12 Jun 2023 21:56:09 -0700 Subject: [PATCH] Test Cleanup (#87450) --- .../tests/CultureInfo/CultureInfoCtor.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs b/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs index 8f056a90f5990..d5c4bc44d29e3 100644 --- a/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs +++ b/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs @@ -441,6 +441,8 @@ public void TestCreationWithTemporaryLCID(int lcid) Assert.NotEqual(lcid, new CultureInfo(lcid).LCID); } + private static bool NotWasmWithIcu => PlatformDetection.IsNotBrowser && PlatformDetection.IsIcuGlobalization; + [InlineData("zh-TW-u-co-zhuyin", "zh-TW", "zh-TW_zhuyin")] [InlineData("de-DE-u-co-phonebk", "de-DE", "de-DE_phoneboo")] [InlineData("de-DE-u-co-phonebk-u-xx", "de-DE-u-xx", "de-DE-u-xx_phoneboo")] @@ -449,7 +451,7 @@ public void TestCreationWithTemporaryLCID(int lcid) [InlineData("de-DE-u-co-phonebk-t-xx", "de-DE-t-xx", "de-DE-t-xx_phoneboo")] [InlineData("de-DE-u-co-phonebk-t-xx-u-yy", "de-DE-t-xx-u-yy", "de-DE-t-xx-u-yy_phoneboo")] [InlineData("de-DE", "de-DE", "de-DE")] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalization))] + [ConditionalTheory(nameof(NotWasmWithIcu))] public void TestCreationWithMangledSortName(string cultureName, string expectedCultureName, string expectedSortName) { CultureInfo ci = CultureInfo.GetCultureInfo(cultureName); @@ -458,13 +460,6 @@ public void TestCreationWithMangledSortName(string cultureName, string expectedC Assert.Equal(expectedSortName, ci.CompareInfo.Name); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalization))] - public void TestNeutralCultureWithCollationName() - { - Assert.Throws(() => CultureInfo.GetCultureInfo("zh-u-co-zhuyin")); - Assert.Throws(() => CultureInfo.GetCultureInfo("de-u-co-phonebk")); - } - private static bool SupportRemoteExecutionWithIcu => RemoteExecutor.IsSupported && PlatformDetection.IsIcuGlobalization; [InlineData("xx-u-XX", "xx-u-xx")]