mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 16:36:30 +00:00
vim-patch:8.2.2286: sort test fails when locale is Canadian English
Problem: Sort test fails when locale is Canadian English. (Neil H Watson)
Solution: Expect a different sort order. (closes vim/vim#7609)
fefa6c347e
This commit is contained in:
@@ -22,14 +22,18 @@ func Test_sort_strings()
|
|||||||
|
|
||||||
" This does not appear to work correctly on Mac.
|
" This does not appear to work correctly on Mac.
|
||||||
if !has('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
|
" With the following locales, the accentuated letters are ordered
|
||||||
" similarly to the non-accentuated letters...
|
" similarly to the non-accentuated letters...
|
||||||
if v:collate =~? '^\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8$'
|
|
||||||
call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'œ', 'p', 'P'],
|
call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'œ', 'p', 'P'],
|
||||||
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
|
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
|
||||||
|
elseif v:collate =~? '^sv.*utf-\?8$'
|
||||||
" ... whereas with a Swedish locale, the accentuated letters are ordered
|
" ... whereas with a Swedish locale, the accentuated letters are ordered
|
||||||
" after Z.
|
" after Z.
|
||||||
elseif v:collate =~? '^sv.*utf-\?8$'
|
|
||||||
call assert_equal(['a', 'A', 'o', 'O', 'p', 'P', 'ä', 'Ä', 'œ', 'œ', 'ô', 'Ô'],
|
call assert_equal(['a', 'A', 'o', 'O', 'p', 'P', 'ä', 'Ä', 'œ', 'œ', 'ô', 'Ô'],
|
||||||
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
|
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
|
||||||
endif
|
endif
|
||||||
@@ -1249,13 +1253,62 @@ func Test_sort_cmd()
|
|||||||
\ },
|
\ },
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
" With the following locales, the accentuated letters are ordered
|
" This does not appear to work correctly on Mac.
|
||||||
" similarly to the non-accentuated letters.
|
if !has('mac')
|
||||||
" This does not appear to work on Mac
|
if v:collate =~? '^en_ca.*\.utf-\?8$'
|
||||||
if v:collate =~? '^\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8$' && !has('mac')
|
" en_CA.utf-8 sorts capitals before lower case
|
||||||
let tests += [
|
let tests += [
|
||||||
\ {
|
\ {
|
||||||
\ 'name' : 'sort with locale',
|
\ 'name' : 'sort with locale ' .. v:collate,
|
||||||
|
\ 'cmd' : '%sort l',
|
||||||
|
\ 'input' : [
|
||||||
|
\ 'A',
|
||||||
|
\ 'E',
|
||||||
|
\ 'O',
|
||||||
|
\ 'À',
|
||||||
|
\ 'È',
|
||||||
|
\ 'É',
|
||||||
|
\ 'Ô',
|
||||||
|
\ 'Œ',
|
||||||
|
\ 'Z',
|
||||||
|
\ 'a',
|
||||||
|
\ 'e',
|
||||||
|
\ 'o',
|
||||||
|
\ 'à',
|
||||||
|
\ 'è',
|
||||||
|
\ 'é',
|
||||||
|
\ 'ô',
|
||||||
|
\ 'œ',
|
||||||
|
\ 'z'
|
||||||
|
\ ],
|
||||||
|
\ 'expected' : [
|
||||||
|
\ 'A',
|
||||||
|
\ 'a',
|
||||||
|
\ 'À',
|
||||||
|
\ 'à',
|
||||||
|
\ 'E',
|
||||||
|
\ 'e',
|
||||||
|
\ 'É',
|
||||||
|
\ 'é',
|
||||||
|
\ 'È',
|
||||||
|
\ 'è',
|
||||||
|
\ 'O',
|
||||||
|
\ 'o',
|
||||||
|
\ 'Ô',
|
||||||
|
\ 'ô',
|
||||||
|
\ 'œ',
|
||||||
|
\ 'Œ',
|
||||||
|
\ 'Z',
|
||||||
|
\ 'z'
|
||||||
|
\ ]
|
||||||
|
\ },
|
||||||
|
\ ]
|
||||||
|
elseif v:collate =~? '^\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8$'
|
||||||
|
" With these locales, the accentuated letters are ordered
|
||||||
|
" similarly to the non-accentuated letters.
|
||||||
|
let tests += [
|
||||||
|
\ {
|
||||||
|
\ 'name' : 'sort with locale ' .. v:collate,
|
||||||
\ 'cmd' : '%sort l',
|
\ 'cmd' : '%sort l',
|
||||||
\ 'input' : [
|
\ 'input' : [
|
||||||
\ 'A',
|
\ 'A',
|
||||||
@@ -1300,6 +1353,7 @@ func Test_sort_cmd()
|
|||||||
\ },
|
\ },
|
||||||
\ ]
|
\ ]
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
for t in tests
|
for t in tests
|
||||||
enew!
|
enew!
|
||||||
|
Reference in New Issue
Block a user