Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing tests for nonzero output of localeCompare respecting canonical equivalence #3453

Open
gibson042 opened this issue Mar 30, 2022 · 0 comments

Comments

@gibson042
Copy link
Contributor

Followup from #3439:

I'd also like to add some tests verifying that non-zero output [from String.prototype.localeCompare] is not affected by changing between canonically equivalent sequences in a substring, but I'm not sure where to add them. And at any rate, they can be introduced in a followup.

Some examples of what to verify:

  • Canonical equivalence between [U+212B ANGSTROM SIGN] and [U+0041 LATIN CAPITAL LETTER A, U+030A COMBINING RING ABOVE] implies that "\u0426".localeCompare("\u212B") and "\u0426".localeCompare("A\u030A") must have the same sign.
  • Canonical equivalence between [U+212B ANGSTROM SIGN] and [U+0041 LATIN CAPITAL LETTER A, U+030A COMBINING RING ABOVE] implies that "A\u0361".localeCompare("\u212B") and "A\u0361".localeCompare("A\u030A") must have the same sign.
  • Canonical equivalence between [U+2126 OHM SIGN] and Ω [U+03A9 GREEK CAPITAL LETTER OMEGA] implies that "\u0426".localeCompare("\u2126") and "\u0426".localeCompare("\u03A9") must have the same sign.
  • Canonical equivalence between [U+1E69 LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE] and ṩ [U+0073 LATIN SMALL LETTER S, U+0307 COMBINING DOT ABOVE, U+0323 COMBINING DOT BELOW] implies that "\u0426".localeCompare("\u1E69") and "\u0426".localeCompare("s\u0307\u0323") must have the same sign.
  • Canonical equivalence between [U+1E69 LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE] and ṩ [U+0073 LATIN SMALL LETTER S, U+0307 COMBINING DOT ABOVE, U+0323 COMBINING DOT BELOW] implies that "s\u0361".localeCompare("\u1E69") and "s\u0361".localeCompare("s\u0307\u0323") must have the same sign.
  • Canonical equivalence between [U+1E69 LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE] and ṩ [U+0073 LATIN SMALL LETTER S, U+0307 COMBINING DOT ABOVE, U+0323 COMBINING DOT BELOW] implies that "s\u0306".localeCompare("\u1E69") and "s\u0306".localeCompare("s\u0307\u0323") must have the same sign.
  • Canonical equivalence between [U+1E69 LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE] and ṩ [U+0073 LATIN SMALL LETTER S, U+0307 COMBINING DOT ABOVE, U+0323 COMBINING DOT BELOW] implies that "s\u0308".localeCompare("\u1E69") and "s\u0308".localeCompare("s\u0307\u0323") must have the same sign.
  • Canonical equivalence between ḍ̇ [U+1E0B LATIN SMALL LETTER D WITH DOT ABOVE, U+0323 COMBINING DOT BELOW] and ḍ̇ [U+1E0D LATIN SMALL LETTER D WITH DOT BELOW, U+0307 COMBINING DOT ABOVE] implies that "\u1E0C".localeCompare("\u1E0B\u0323") and "\u1E0C".localeCompare("\u1E0D\u0307") must have the same sign.
  • Canonical equivalence between [U+AC00 HANGUL SYLLABLE GA] and 가 [U+1100 HANGUL CHOSEONG KIYEOK, U+1161 HANGUL JUNGSEONG A] implies that "\u1680".localeCompare("\uAC00") and "\u1680".localeCompare("\u1100\u1161") must have the same sign.
  • Canonical equivalence between [U+AC00 HANGUL SYLLABLE GA] and 가 [U+1100 HANGUL CHOSEONG KIYEOK, U+1161 HANGUL JUNGSEONG A] implies that "\u1100\u1166".localeCompare("\uAC00") and "\u1100\u1166".localeCompare("\u1100\u1161") must have the same sign.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant