Skip to content

NLS System.Globalization.Tests.CompareInfoTests.SortKeyTest with empty string and ZWJ fails on Windows Insiders Preview #42115

Closed
@Gnbrkm41

Description

@Gnbrkm41

This is under the NLS configuration (System.Globalization.Nls.Tests), not sure if it's specific to the version of NLS that ships with the insider builds. Currently I'm running 10 Pro Insiders Build (Dev Channel) Build 20211, ko-KR.

// Zero-weight code points
// In both NLS (Windows) and ICU the code point U+200C ZERO WIDTH NON-JOINER has a zero weight,
// so it's compared as equal to the empty string. This means that we can't special-case GetHashCode("")
// and return a fixed value; we actually need to call the underlying OS or ICU API to calculate the sort key.
yield return new object[] { s_invariantCompare, "", "\u200c", CompareOptions.None, 0 };

Raw XML output:

<test name="System.Globalization.Tests.CompareInfoTests.SortKeyTest(compareInfo: CompareInfo - , string1: \&quot;\&quot;, string2: \&quot;‌\&quot;, options: None, expectedSign: 0)" type="System.Globalization.Tests.CompareInfoTests" method="SortKeyTest" time="0.0054359" result="Fail">
  <failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\r\nExpected: -1\r\nActual:   0]]></message>
    <stack-trace><![CDATA[   at System.Globalization.Tests.CompareInfoTests.SortKeyTest(CompareInfo compareInfo, String string1, String string2, CompareOptions options, Int32 expectedSign) in C:\Users\gotos\source\repos\runtime\src\libraries\System.Globalization\tests\CompareInfo\CompareInfoTests.cs:line 371]]></stack-trace>
  </failure>
</test>

cc @tarekgh

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions