Missing tests for nonzero output of localeCompare respecting canonical equivalence
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 564
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 10
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test path is named. Start at String.prototype.localeCompare and locate the existing localeCompare tests, then add coverage for the listed canonically equivalent pairs by checking that each comparison has the same sign; run the relevant test262 tests to confirm the assertions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- internationalization, testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100