Skip to content

Commit

Permalink
[browser] Remove WASM HybridGlobalization from library tests, WBT a…
Browse files Browse the repository at this point in the history
…nd docs (#110534)

* Remove `HybridGlobalization` from library tests.

* Remove `HybridGlobalization` from WBT.

* Remove docs about HG on WASM.
  • Loading branch information
ilonatommy authored Dec 11, 2024
1 parent fc620a3 commit 39111b0
Show file tree
Hide file tree
Showing 64 changed files with 212 additions and 4,832 deletions.
376 changes: 0 additions & 376 deletions docs/design/features/globalization-hybrid-mode.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion eng/testing/scenarios/BuildWasmAppsJobsList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Wasm.Build.Tests.Blazor.IcuShardingTests
Wasm.Build.Tests.Blazor.SignalRClientTests
Wasm.Build.Tests.BuildPublishTests
Wasm.Build.Tests.ConfigSrcTests
Wasm.Build.Tests.HybridGlobalizationTests
Wasm.Build.Tests.IcuShardingTests
Wasm.Build.Tests.IcuShardingTests2
Wasm.Build.Tests.IcuTests
Expand Down
1 change: 0 additions & 1 deletion eng/testing/tests.browser.targets
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@
<_WasmPropertyNames Include="EmccLinkOptimizationFlag" />
<_WasmPropertyNames Include="WasmIncludeFullIcuData" />
<_WasmPropertyNames Include="WasmIcuDataFileName" />
<_WasmPropertyNames Include="HybridGlobalization" />
</ItemGroup>
</Target>

Expand Down
1 change: 0 additions & 1 deletion eng/testing/tests.wasi.targets
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
<_WasmPropertyNames Include="WasiClangLinkOptimizationFlag" />
<_WasmPropertyNames Include="WasmIncludeFullIcuData" />
<_WasmPropertyNames Include="WasmIcuDataFileName" />
<_WasmPropertyNames Include="HybridGlobalization" />
</ItemGroup>
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,7 @@ public static string GetDistroVersionString()

public static bool IsInvariantGlobalization => m_isInvariant.Value;
public static bool IsHybridGlobalization => m_isHybrid.Value;
public static bool IsHybridGlobalizationOnBrowser => m_isHybrid.Value && IsBrowser;
public static bool IsHybridGlobalizationOnApplePlatform => m_isHybrid.Value && (IsMacCatalyst || IsiOS || IstvOS);
public static bool IsNotHybridGlobalizationOnBrowser => !IsHybridGlobalizationOnBrowser;
public static bool IsNotInvariantGlobalization => !IsInvariantGlobalization;
public static bool IsNotHybridGlobalization => !IsHybridGlobalization;
public static bool IsNotHybridGlobalizationOnApplePlatform => !IsHybridGlobalizationOnApplePlatform;
Expand All @@ -401,8 +399,6 @@ public static string GetDistroVersionString()

// HG on apple platforms implies ICU
public static bool IsIcuGlobalization => !IsInvariantGlobalization && (IsHybridGlobalizationOnApplePlatform || ICUVersion > new Version(0, 0, 0, 0));

public static bool IsIcuGlobalizationAndNotHybridOnBrowser => IsIcuGlobalization && IsNotHybridGlobalizationOnBrowser;
public static bool IsNlsGlobalization => IsNotInvariantGlobalization && !IsIcuGlobalization && !IsHybridGlobalization;

public static bool IsSubstAvailable
Expand Down
12 changes: 4 additions & 8 deletions src/libraries/Common/tests/Tests/System/StringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ public static void CompareToNoMatch_StringComparison()
var secondSpan = new ReadOnlySpan<char>(second);
Assert.True(0 > firstSpan.CompareTo(secondSpan, StringComparison.Ordinal));

// On Apple platforms, string comparison is handled by native Apple functions, which apply normalization techniques
// On Apple platforms, string comparison is handled by native Apple functions, which apply normalization techniques
// like `precomposedStringWithCanonicalMapping`. This can lead to differences in behavior compared to other platforms.
if (PlatformDetection.IsNotHybridGlobalizationOnApplePlatform)
{
Expand Down Expand Up @@ -1315,7 +1315,7 @@ public static void ContainsNoMatch_StringComparison()

Assert.False(firstSpan.Contains(secondSpan, StringComparison.OrdinalIgnoreCase));

// On Apple platforms, string comparison is handled by native Apple functions, which apply normalization techniques
// On Apple platforms, string comparison is handled by native Apple functions, which apply normalization techniques
// like `precomposedStringWithCanonicalMapping`. This can lead to differences in behavior compared to other platforms.
if (PlatformDetection.IsNotHybridGlobalizationOnApplePlatform)
{
Expand Down Expand Up @@ -3227,17 +3227,15 @@ which ignore the contraction collation weights (defined as 'tertiary' rules)
Assert.Equal(PlatformDetection.IsNlsGlobalization ? 0 : -1, source.IndexOf(target));
Assert.Equal(PlatformDetection.IsNlsGlobalization ? 0 : -1, source.IndexOf(target, StringComparison.CurrentCulture));

if (!PlatformDetection.IsHybridGlobalizationOnBrowser)
Assert.Equal(0, source.IndexOf(target, StringComparison.CurrentCultureIgnoreCase));
Assert.Equal(0, source.IndexOf(target, StringComparison.CurrentCultureIgnoreCase));
Assert.Equal(-1, source.IndexOf(target, StringComparison.Ordinal));
Assert.Equal(-1, source.IndexOf(target, StringComparison.OrdinalIgnoreCase));

ReadOnlySpan<char> span = source.AsSpan();

Assert.Equal(PlatformDetection.IsNlsGlobalization ? 0 : -1, span.IndexOf(target.AsSpan(), StringComparison.CurrentCulture));

if (!PlatformDetection.IsHybridGlobalizationOnBrowser)
Assert.Equal(0, span.IndexOf(target.AsSpan(), StringComparison.CurrentCultureIgnoreCase));
Assert.Equal(0, span.IndexOf(target.AsSpan(), StringComparison.CurrentCultureIgnoreCase));
Assert.Equal(-1, span.IndexOf(target.AsSpan(), StringComparison.Ordinal));
Assert.Equal(-1, span.IndexOf(target.AsSpan(), StringComparison.OrdinalIgnoreCase));
}
Expand Down Expand Up @@ -5425,7 +5423,6 @@ private static IEnumerable<object[]> ToLower_Culture_TestData()

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95338", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnApplePlatform))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95503", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))]
public static void Test_ToLower_Culture()
{
foreach (object[] testdata in ToLower_Culture_TestData())
Expand Down Expand Up @@ -5943,7 +5940,6 @@ public static IEnumerable<object[]> ToUpper_Culture_TestData()
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95338", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnApplePlatform))]
[MemberData(nameof(ToUpper_Culture_TestData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95503", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))]
public static void Test_ToUpper_Culture(string actual, string expected, CultureInfo culture)
{
Assert.Equal(expected, actual.ToUpper(culture));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ namespace Microsoft.VisualBasic.CompilerServices.Tests
{
public class LateBindingTests
{
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(LateCall_TestData))]
public void LateCall(object obj, Type objType, string name, object[] args, string[] paramNames, bool[] copyBack, Func<object, object> getResult, object expected)
{
LateBinding.LateCall(obj, objType, name, args, paramNames, copyBack);
Assert.Equal(expected, getResult(obj));
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(LateGet_TestData))]
public void LateGet(object obj, Type objType, string name, object[] args, string[] paramNames, bool[] copyBack, object expected)
{
Assert.Equal(expected, LateBinding.LateGet(obj, objType, name, args, paramNames, copyBack));
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(LateSet_TestData))]
public void LateSet(object obj, Type objType, string name, object[] args, string[] paramNames, Func<object, object> getResult, object expected)
{
Expand Down Expand Up @@ -74,14 +74,14 @@ public void LateIndexSet(object obj, object[] args, string[] paramNames, Func<ob
Assert.Equal(expected, getResult(obj));
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(LateIndexSet_MissingMember_TestData))]
public void LateIndexSet_MissingMember(object obj, object[] args, string[] paramNames)
{
Assert.Throws<MissingMemberException>(() => LateBinding.LateIndexSet(obj, args, paramNames));
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(LateIndexSetComplex_TestData))]
public void LateIndexSetComplex(object obj, object[] args, string[] paramNames, bool missing, bool valueType)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.VisualBasic.CompilerServices.Tests
{
public class LikeOperatorTests
{
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(LikeObject_TestData))]
[MemberData(nameof(LikeString_TestData))]
public void LikeObject(object source, object pattern, object expectedBinaryCompare, object expectedTextCompare)
Expand All @@ -18,7 +18,7 @@ public void LikeObject(object source, object pattern, object expectedBinaryCompa
Assert.Equal(expectedTextCompare, LikeOperator.LikeObject(source, pattern, CompareMethod.Text));
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(LikeString_TestData))]
public void LikeString(string source, string pattern, bool expectedBinaryCompare, bool expectedTextCompare)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public static IEnumerable<object[]> GetObjectValuePrimitive_TestData()
// Add more...
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(LikeObj_TestData))]
public void LikeObj(object left, object right, object expectedBinaryCompare, object expectedTextCompare)
{
Expand Down Expand Up @@ -323,7 +323,7 @@ public static IEnumerable<object[]> LikeObj_NullReference_TestData()
yield return new object[] { null, "*" };
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(ObjTst_TestData))]
public void ObjTst(object x, object y, bool textCompare, object expected)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ public static IEnumerable<object[]> Compare_InvalidObjects_TestData()
yield return new object[] { new object(), new char[] { '8' } };
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void CompareObjectEqual_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down Expand Up @@ -1171,7 +1171,7 @@ public class CompareObjectEqual
public static string op_Equality(OperatorsTests left, CompareObjectEqual right) => "tcejbomotsuc";
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void CompareObjectGreater_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down Expand Up @@ -1235,7 +1235,7 @@ public class CompareObjectGreater
public static string op_GreaterThan(OperatorsTests left, CompareObjectGreater right) => "tcejbomotsuc";
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void CompareObjectGreaterEqual_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down Expand Up @@ -1298,7 +1298,7 @@ public class CompareObjectGreaterEqual
public static string op_GreaterThanOrEqual(OperatorsTests left, CompareObjectGreaterEqual right) => "tcejbomotsuc";
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void CompareObjectLess_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down Expand Up @@ -1362,7 +1362,7 @@ public class CompareObjectLess
public static string op_LessThan(OperatorsTests left, CompareObjectLess right) => "tcejbomotsuc";
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void CompareObjectLessEqual_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down Expand Up @@ -1425,7 +1425,7 @@ public class CompareObjectLessEqual
public static string op_LessThanOrEqual(OperatorsTests left, CompareObjectLessEqual right) => "tcejbomotsuc";
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void CompareObjectNotEqual_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down Expand Up @@ -1490,7 +1490,7 @@ public class CompareObjectNotEqual
}


[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void ConditionalCompareObjectEqual_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down Expand Up @@ -1554,7 +1554,7 @@ public class ConditionalCompareObjectEqual
public static bool op_Equality(OperatorsTests left, ConditionalCompareObjectEqual right) => true;
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void ConditionalCompareObjectGreater_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down Expand Up @@ -1618,7 +1618,7 @@ public class ConditionalCompareObjectGreater
public static bool op_GreaterThan(OperatorsTests left, ConditionalCompareObjectGreater right) => true;
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void ConditionalCompareObjectGreaterEqual_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down Expand Up @@ -1681,7 +1681,7 @@ public class ConditionalCompareObjectGreaterEqual
public static bool op_GreaterThanOrEqual(OperatorsTests left, ConditionalCompareObjectGreaterEqual right) => true;
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void ConditionalCompareObjectLess_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down Expand Up @@ -1745,7 +1745,7 @@ public class ConditionalCompareObjectLess
public static bool op_LessThan(OperatorsTests left, ConditionalCompareObjectLess right) => true;
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void ConditionalCompareObjectLessEqual_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down Expand Up @@ -1808,7 +1808,7 @@ public class ConditionalCompareObjectLessEqual
public static bool op_LessThanOrEqual(OperatorsTests left, ConditionalCompareObjectLessEqual right) => true;
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(Compare_Primitives_TestData))]
public void ConditionalCompareObjectNotEqual_Invoke_ReturnsExpected(object left, object right, bool greater, bool equal, bool less)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public void MidStmtStr_ArgumentException(string str, int start, int length, stri
Assert.Throws<ArgumentException>(() => StringType.MidStmtStr(ref str, start, length, insert));
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[MemberData(nameof(StrCmp_TestData))]
public void StrCmp(string left, string right, int expectedBinaryCompare, int expectedTextCompare)
{
Expand All @@ -388,7 +388,7 @@ public static IEnumerable<object[]> StrCmp_TestData()
yield return new object[] { "abc", "ABC", 32, 0 };
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[Theory]
[InlineData(null, null, true, true)]
[InlineData("", null, true, true)]
[InlineData("", "*", true, true)]
Expand Down
Loading

0 comments on commit 39111b0

Please sign in to comment.