mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 8.2.1935: sort test fails on Mac
Problem: Sort test fails on Mac. Solution: Disable the sort test with locale on Mac.
This commit is contained in:
@@ -22,17 +22,20 @@ func Test_sort_strings()
|
|||||||
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', 'Ä', 'ä', 'ô', 'Ô'], 'i'))
|
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'i'))
|
||||||
|
|
||||||
let lc = execute('language collate')
|
" This does not appear to work correctly on Mac.
|
||||||
" With the following locales, the accentuated letters are ordered
|
if !has('mac')
|
||||||
" similarly to the non-accentuated letters...
|
let lc = execute('language collate')
|
||||||
if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"'
|
" With the following locales, the accentuated letters are ordered
|
||||||
call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'œ', 'p', 'P'],
|
" similarly to the non-accentuated letters...
|
||||||
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
|
if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"'
|
||||||
" ... whereas with a Swedish locale, the accentuated letters are ordered
|
call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'œ', 'p', 'P'],
|
||||||
" after Z.
|
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
|
||||||
elseif lc =~? '"sv.*utf-\?8"'
|
" ... whereas with a Swedish locale, the accentuated letters are ordered
|
||||||
call assert_equal(['a', 'A', 'o', 'O', 'p', 'P', 'ä', 'Ä', 'œ', 'œ', 'ô', 'Ô'],
|
" after Z.
|
||||||
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
|
elseif lc =~? '"sv.*utf-\?8"'
|
||||||
|
call assert_equal(['a', 'A', 'o', 'O', 'p', 'P', 'ä', 'Ä', 'œ', 'œ', 'ô', 'Ô'],
|
||||||
|
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -1224,9 +1227,10 @@ func Test_sort_cmd()
|
|||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
" 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.
|
||||||
|
" This does not appear to work on Mac
|
||||||
let lc = execute('language collate')
|
let lc = execute('language collate')
|
||||||
if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"'
|
if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"' && !has('mac')
|
||||||
let tests += [
|
let tests += [
|
||||||
\ {
|
\ {
|
||||||
\ 'name' : 'sort with locale',
|
\ 'name' : 'sort with locale',
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1935,
|
||||||
/**/
|
/**/
|
||||||
1934,
|
1934,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user