sort: Fix inconsistent sort orderg under i18n-collator with equal sorting keys.#12013
sort: Fix inconsistent sort orderg under i18n-collator with equal sorting keys.#12013ksgk1 wants to merge 8 commits intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
Merging this PR will improve performance by 31.27%
Performance Changes
Comparing Footnotes
|
|
Can you please add a test to |
|
I updated my code, and added different test cases. |
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
| let expected_output = "01\n01\n0_1\n0_1\n02\n02\n"; | ||
| new_ucmd!() | ||
| .env("LC_ALL", "en_US.UTF-8") | ||
| .arg("fix_i18n_collate_inconsistency_1.txt") | ||
| .arg("fix_i18n_collate_inconsistency_2.txt") | ||
| .succeeds() | ||
| .stdout_is(expected_output); |
There was a problem hiding this comment.
I think this test is not correct as GNU sort returns a different result when running the command manually:
$ LC_ALL=en_US.UTF-8 sort tests/fixtures/sort/fix_i18n_collate_inconsistency_1.txt tests/fixtures/sort/fix_i18n_collate_inconsistency_2.txt
0_1
0_1
01
01
02
02
|
Thank you a lot for the valuable feedback. I will fix those issues as soon as possible and verify my implementation against sort's output. |
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
In #11980 it was noted, that the sorting behaviour was inconsistent. The cause for this was equal sorting keys, without a fallback option.
I implemented a fallback for equal keys, that fixes this issue.