Patch 8.2.2287
Problem: Sort test fails when locale is French Canadian.
Solution: Expect a different sort order. (Dominique Pellé, closes #7609)
Files: src/testdir/test_sort.vim
*** ../vim-8.2.2286/src/testdir/test_sort.vim 2021-01-03 16:18:00.575808378 +0100
--- src/testdir/test_sort.vim 2021-01-03 17:35:07.199645726 +0100
***************
*** 16,38 ****
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', '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')
" 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'))
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'))
elseif v:collate =~? '^sv.*utf-\?8$'
" ... whereas with a Swedish locale, the accentuated letters are ordered
" after Z.
--- 16,39 ----
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', '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\|fr\)_ca.utf-\?8$'
" with Canadian English capitals come before lower case.
! " 'Œ' 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'))
elseif v:collate =~? '^sv.*utf-\?8$'
" ... whereas with a Swedish locale, the accentuated letters are ordered
" after Z.
***************
*** 1236,1243 ****
" This does not appear to work correctly on Mac.
if !has('mac')
! if v:collate =~? '^en_ca.*\.utf-\?8$'
" en_CA.utf-8 sorts capitals before lower case
let tests += [
\ {
\ 'name' : 'sort with locale ' .. v:collate,
--- 1237,1245 ----
" This does not appear to work correctly on Mac.
if !has('mac')
! 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,
***************
*** 1250,1256 ****
\ 'È',
\ 'É',
\ 'Ô',
- \ 'Œ',
\ 'Z',
\ 'a',
\ 'e',
--- 1252,1257 ----
***************
*** 1278,1284 ****
\ 'Ô',
\ 'ô',
\ 'œ',
- \ 'Œ',
\ 'Z',
\ 'z'
\ ]
--- 1279,1284 ----
*** ../vim-8.2.2286/src/version.c 2021-01-03 16:18:00.575808378 +0100
--- src/version.c 2021-01-03 17:38:46.614816201 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2287,
/**/
--
From "know your smileys":
(X0||) Double hamburger with lettuce and tomato
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///