Fix forder-order equivalence test for atypical collate locales - #7837
Fix forder-order equivalence test for atypical collate locales#7837MichaelChirico wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7837 +/- ##
=======================================
Coverage 99.01% 99.01%
=======================================
Files 88 88
Lines 17286 17286
=======================================
Hits 17116 17116
Misses 170 170 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f93fce1 to
746918d
Compare
39d4309 to
cf55605
Compare
9972feb to
f2a0220
Compare
cf55605 to
995819c
Compare
f2a0220 to
75ec5b2
Compare
9548bbd to
4c6d0a2
Compare
|
Generated via commit 096e827 Download link for the artifact containing the test results: ↓ atime-results.zip
|
4c6d0a2 to
01b4d1f
Compare
01b4d1f to
0b5068c
Compare
|
The approach with sort(c('ib', 'ya'))
# [1] "ya" "ib"
sort(c('i', 'y'))
# [1] "i" "y"i.e. there's a mix of right-to-left and left-to-right logic to determine sort order. Now, I am trying |
a8b67f9 to
cda0c41
Compare
9eaee4d to
47d54bc
Compare
cda0c41 to
f31ac69
Compare
d7cf097 to
5b56eb4
Compare
401eb10 to
c4a4fee
Compare
16f7a09 to
417989b
Compare
a0baec7 to
a80cd2f
Compare
de8913a to
096e827
Compare
096e827 to
e40fca4
Compare

Running
test.data.table()in anLC_ALL=lv_LV.utf8session can error like:It's all down to
xtfrm(letters)not being able to support C-collated sorting, so using it in a locale wheresort(letters)differs from ASCII causes issues.In 268c7d6, I tried just using
order(method='radix')as much as possible, but tests1252.*explicitly guard against doing that given it's kinda pointless to test our implementation against... whatever drift has happened between our implementations since our algorithm was first merged into {base}.So here, I take the approach to avoid using all of
lettersin such cases, instead focusing on the C-sortable subset ofletters(see comment below for more nuance on this).According to Gemini, the three most adversarial locales for this exercise are
lv_LV,lt_LT, andaz_AZ, each of which leave only 11 letters in the chosen algorithm. I confirm that result, but it doesn't rule out there being some other more adversarial locale. Gemini also mentionshaw_USandsm_WScould leave 9, but it seems like in practice those locales just use normal ASCII sorting.