Skip to content

Commit cec77d4

Browse files
committed
patch 8.2.2287: sort test fails when locale is French Canadian
Problem: Sort test fails when locale is French Canadian. Solution: Expect a different sort order. (Dominique Pellé, closes #7609)
1 parent fefa6c3 commit cec77d4

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

src/testdir/test_sort.vim

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,24 @@ func Test_sort_strings()
1616
call assert_equal([1, 2, 3], sort([3, 2, 1]))
1717
call assert_equal([13, 28, 3], sort([3, 28, 13]))
1818

19-
call assert_equal(['A', 'O', 'P', 'a', 'o', 'p', 'Ä', 'Ô', 'ä', 'ô', 'œ', 'œ'],
20-
\ sort(['A', 'O', 'P', 'a', 'o', 'p', 'Ä', 'Ô', 'ä', 'ô', 'œ', 'œ']))
19+
call assert_equal(['A', 'O', 'P', 'a', 'o', 'p', 'Ä', 'Ô', 'ä', 'ô', 'Œ', 'œ'],
20+
\ sort(['A', 'O', 'P', 'a', 'o', 'p', 'Ä', 'Ô', 'ä', 'ô', 'œ', 'Œ']))
2121

22-
call assert_equal(['A', 'a', 'o', 'O', 'p', 'P', 'Ä', 'Ô', 'ä', 'ô', 'œ', 'œ'],
23-
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'i'))
22+
call assert_equal(['A', 'a', 'o', 'O', 'p', 'P', 'Ä', 'Ô', 'ä', 'ô', 'Œ', 'œ'],
23+
\ sort(['A', 'a', 'o', 'O', 'œ', 'Œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'i'))
2424

2525
" This does not appear to work correctly on Mac.
2626
if !has('mac')
27-
if v:collate =~? '^en_ca.*\.utf-\?8$' && !has('mac')
27+
if v:collate =~? '^\(en\|fr\)_ca.utf-\?8$'
2828
" with Canadian English capitals come before lower case.
29-
call assert_equal(['A', 'a', 'Ä', 'ä', 'O', 'o', 'Ô', 'ô', 'œ', 'œ', 'P', 'p'],
30-
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
29+
" 'Œ' is omitted because it can sort before or after 'œ'
30+
call assert_equal(['A', 'a', 'Ä', 'ä', 'O', 'o', 'Ô', 'ô', 'œ', 'P', 'p'],
31+
\ sort(['A', 'a', 'o', 'O', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
3132
elseif v:collate =~? '^\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8$'
3233
" With the following locales, the accentuated letters are ordered
3334
" similarly to the non-accentuated letters...
34-
call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'œ', 'p', 'P'],
35-
\ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
35+
call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'Œ', 'p', 'P'],
36+
\ sort(['A', 'a', 'o', 'O', 'œ', 'Œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l'))
3637
elseif v:collate =~? '^sv.*utf-\?8$'
3738
" ... whereas with a Swedish locale, the accentuated letters are ordered
3839
" after Z.
@@ -1236,8 +1237,9 @@ func Test_sort_cmd()
12361237

12371238
" This does not appear to work correctly on Mac.
12381239
if !has('mac')
1239-
if v:collate =~? '^en_ca.*\.utf-\?8$'
1240+
if v:collate =~? '^\(en\|fr\)_ca.utf-\?8$'
12401241
" en_CA.utf-8 sorts capitals before lower case
1242+
" 'Œ' is omitted because it can sort before or after 'œ'
12411243
let tests += [
12421244
\ {
12431245
\ 'name' : 'sort with locale ' .. v:collate,
@@ -1250,7 +1252,6 @@ func Test_sort_cmd()
12501252
\ 'È',
12511253
\ 'É',
12521254
\ 'Ô',
1253-
\ 'Œ',
12541255
\ 'Z',
12551256
\ 'a',
12561257
\ 'e',
@@ -1278,7 +1279,6 @@ func Test_sort_cmd()
12781279
\ 'Ô',
12791280
\ 'ô',
12801281
\ 'œ',
1281-
\ 'Œ',
12821282
\ 'Z',
12831283
\ 'z'
12841284
\ ]

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2287,
753755
/**/
754756
2286,
755757
/**/

0 commit comments

Comments
 (0)