Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,28 @@ public static IEnumerable<object[]> Ctor_String_TestData()
}
}

public static IEnumerable<object[]> Ctor_Undetermined_TestData()
{
yield return new object[] { "und-us", "und-US", "und-US" };
yield return new object[] { "und-us_tradnl", "und-US", "und-US_tradnl"};

// On AppleMobile, the behavior of CultureInfo differs due to platform-specific
// handling of Unicode extensions and subtags. These platforms preserve the full language tag, including
// extensions, while other platforms normalize the tag to a simpler form.
if (PlatformDetection.IsAppleMobile)
{
yield return new object[] { "und-es-u-co-phoneb", "und-ES-u-co-phoneb", "und-ES-u-co-phoneb" };
yield return new object[] { "und-es-t-something", "und-ES-t-something", "und-ES-t-something" };
}
else
{
yield return new object[] { "und-es-u-co-phoneb", "und-ES", "und-ES_phoneb" };
yield return new object[] { "und-es-t-something", "und-ES", "und-ES"};
}
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalization))]
[InlineData("und-us", "und-US", "und-US")]
[InlineData("und-us_tradnl", "und-US", "und-US_tradnl")]
[InlineData("und-es-u-co-phoneb", "und-ES", "und-ES_phoneb")]
[InlineData("und-es-t-something", "und-ES", "und-ES")]
[MemberData(nameof(Ctor_Undetermined_TestData))]
public void CtorUndeterminedLanguageTag(string cultureName, string expectedCultureName, string expectedSortName)
{
CultureInfo culture = new CultureInfo(cultureName);
Expand Down
Loading