From b530221126bd61edd081eded7afea6141cdef0dd Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Tue, 20 Apr 2021 01:22:19 +0100 Subject: vim-patch:8.2.2287: sort test fails when locale is French Canadian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Sort test fails when locale is French Canadian. Solution: Expect a different sort order. (Dominique Pellé, closes vim/vim#7609) https://github.com/vim/vim/commit/cec77d4530ae51ee9ffe0ab57fa7a37cced2b181 --- src/nvim/testdir/test_sort.vim | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test_sort.vim b/src/nvim/testdir/test_sort.vim index 5ed50c8d05..6d55889641 100644 --- a/src/nvim/testdir/test_sort.vim +++ b/src/nvim/testdir/test_sort.vim @@ -14,23 +14,24 @@ func Test_sort_strings() call assert_equal([1, 2, 3], sort([3, 2, 1])) call assert_equal([13, 28, 3], sort([3, 28, 13])) - call assert_equal(['A', 'O', 'P', 'a', 'o', 'p', 'Ä', 'Ô', 'ä', 'ô', 'œ', 'œ'], - \ sort(['A', 'O', 'P', 'a', 'o', 'p', 'Ä', 'Ô', 'ä', 'ô', 'œ', 'œ'])) + call assert_equal(['A', 'O', 'P', 'a', 'o', 'p', 'Ä', 'Ô', 'ä', 'ô', 'Œ', 'œ'], + \ sort(['A', 'O', 'P', 'a', 'o', 'p', 'Ä', 'Ô', 'ä', 'ô', 'œ', 'Œ'])) - call assert_equal(['A', 'a', 'o', 'O', 'p', 'P', 'Ä', 'Ô', 'ä', 'ô', 'œ', 'œ'], - \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'i')) + call assert_equal(['A', 'a', 'o', 'O', 'p', 'P', 'Ä', 'Ô', 'ä', 'ô', 'Œ', 'œ'], + \ sort(['A', 'a', 'o', 'O', 'œ', 'Œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'i')) " This does not appear to work correctly on Mac. if !has('mac') - if v:collate =~? '^en_ca.*\.utf-\?8$' && !has('mac') + if v:collate =~? '^\(en\|fr\)_ca.utf-\?8$' " with Canadian English capitals come before lower case. - call assert_equal(['A', 'a', 'Ä', 'ä', 'O', 'o', 'Ô', 'ô', 'œ', 'œ', 'P', 'p'], - \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) + " 'Œ' is omitted because it can sort before or after 'œ' + call assert_equal(['A', 'a', 'Ä', 'ä', 'O', 'o', 'Ô', 'ô', 'œ', 'P', 'p'], + \ sort(['A', 'a', 'o', 'O', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) elseif v:collate =~? '^\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8$' " With the following locales, the accentuated letters are ordered " similarly to the non-accentuated letters... - call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'œ', 'p', 'P'], - \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) + call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'Œ', 'p', 'P'], + \ sort(['A', 'a', 'o', 'O', 'œ', 'Œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) elseif v:collate =~? '^sv.*utf-\?8$' " ... whereas with a Swedish locale, the accentuated letters are ordered " after Z. @@ -1255,8 +1256,9 @@ func Test_sort_cmd() " This does not appear to work correctly on Mac. if !has('mac') - if v:collate =~? '^en_ca.*\.utf-\?8$' + if v:collate =~? '^\(en\|fr\)_ca.utf-\?8$' " en_CA.utf-8 sorts capitals before lower case + " 'Œ' is omitted because it can sort before or after 'œ' let tests += [ \ { \ 'name' : 'sort with locale ' .. v:collate, @@ -1269,7 +1271,6 @@ func Test_sort_cmd() \ 'È', \ 'É', \ 'Ô', - \ 'Œ', \ 'Z', \ 'a', \ 'e', @@ -1297,7 +1298,6 @@ func Test_sort_cmd() \ 'Ô', \ 'ô', \ 'œ', - \ 'Œ', \ 'Z', \ 'z' \ ] -- cgit