From 96f62394cfc74e731529ed68039aa8da1facdf13 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Mon, 19 Apr 2021 19:57:19 +0100 Subject: vim-patch:8.2.0174: various commands not completely tested Problem: Various commands not completely tested. Solution: Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5551) https://github.com/vim/vim/commit/5d98dc2a48156d44139b75c689bd3137ff7fe8bf --- src/nvim/testdir/test_sort.vim | 78 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 74 insertions(+), 4 deletions(-) (limited to 'src/nvim/testdir/test_sort.vim') diff --git a/src/nvim/testdir/test_sort.vim b/src/nvim/testdir/test_sort.vim index 7533eaf2e8..8287a761c6 100644 --- a/src/nvim/testdir/test_sort.vim +++ b/src/nvim/testdir/test_sort.vim @@ -1150,7 +1150,7 @@ func Test_sort_cmd() \ 'input' : [ \ '1.234', \ '0.88', - \ '123.456', + \ ' + 123.456', \ '1.15e-6', \ '-1.1e3', \ '-1.01e3', @@ -1165,7 +1165,7 @@ func Test_sort_cmd() \ '1.15e-6', \ '0.88', \ '1.234', - \ '123.456' + \ ' + 123.456' \ ] \ }, \ { @@ -1197,6 +1197,30 @@ func Test_sort_cmd() \ 'cc', \ ] \ }, + \ { + \ 'name' : 'sort one line buffer', + \ 'cmd' : 'sort', + \ 'input' : [ + \ 'single line' + \ ], + \ 'expected' : [ + \ 'single line' + \ ] + \ }, + \ { + \ 'name' : 'sort ignoring case', + \ 'cmd' : '%sort i', + \ 'input' : [ + \ 'BB', + \ 'Cc', + \ 'aa' + \ ], + \ 'expected' : [ + \ 'aa', + \ 'BB', + \ 'Cc' + \ ] + \ }, \ ] for t in tests @@ -1217,7 +1241,11 @@ func Test_sort_cmd() endif endfor - call assert_fails('sort no', 'E474') + " Needs atleast two lines for this test + call setline(1, ['line1', 'line2']) + call assert_fails('sort no', 'E474:') + call assert_fails('sort c', 'E475:') + call assert_fails('sort #pat%', 'E682:') enew! endfunc @@ -1319,4 +1347,46 @@ func Test_sort_cmd_report() " the output comes from the :g command, not from the :sort call assert_match("6 fewer lines", res) enew! - endfunc +endfunc + +" Test for a :sort command followed by another command +func Test_sort_followed_by_cmd() + new + let var = '' + call setline(1, ['cc', 'aa', 'bb']) + %sort | let var = "sortcmdtest" + call assert_equal(var, "sortcmdtest") + call assert_equal(['aa', 'bb', 'cc'], getline(1, '$')) + " Test for :sort followed by a comment + call setline(1, ['3b', '1c', '2a']) + %sort /\d\+/ " sort alphabetically + call assert_equal(['2a', '3b', '1c'], getline(1, '$')) + close! +endfunc + +" Test for :sort using last search pattern +func Test_sort_last_search_pat() + new + let @/ = '\d\+' + call setline(1, ['3b', '1c', '2a']) + sort // + call assert_equal(['2a', '3b', '1c'], getline(1, '$')) + close! +endfunc + +" Test for retaining marks across a :sort +func Test_sort_with_marks() + new + call setline(1, ['cc', 'aa', 'bb']) + call setpos("'c", [0, 1, 0, 0]) + call setpos("'a", [0, 2, 0, 0]) + call setpos("'b", [0, 3, 0, 0]) + %sort + call assert_equal(['aa', 'bb', 'cc'], getline(1, '$')) + call assert_equal(2, line("'a")) + call assert_equal(3, line("'b")) + call assert_equal(1, line("'c")) + close! +endfunc + +" vim: shiftwidth=2 sts=2 expandtab -- cgit From 6a0b8cbd81f81957a415cf03415bf2bffc18b56e Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Mon, 19 Apr 2021 19:57:19 +0100 Subject: vim-patch:8.2.1933: cannot sort using locale ordering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Cannot sort using locale ordering. Solution: Add a flag for :sort and sort() to use the locale. (Dominique Pellé, closes vim/vim#7237) https://github.com/vim/vim/commit/55e29611d20bca14fa5efc61385bc8a6b7acd9e2 --- src/nvim/testdir/test_sort.vim | 71 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'src/nvim/testdir/test_sort.vim') diff --git a/src/nvim/testdir/test_sort.vim b/src/nvim/testdir/test_sort.vim index 8287a761c6..278cbef01e 100644 --- a/src/nvim/testdir/test_sort.vim +++ b/src/nvim/testdir/test_sort.vim @@ -13,6 +13,25 @@ func Test_sort_strings() " numbers compared as 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', 'a', 'o', 'O', 'p', 'P', 'Ä', 'Ô', 'ä', 'ô', 'œ', 'œ'], + \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'i')) + + let lc = execute('language collate') + " With the following locales, the accentuated letters are ordered + " similarly to the non-accentuated letters... + if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"' + call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'œ', 'p', 'P'], + \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) + " ... whereas with a Swedish locale, the accentuated letters are ordered + " after Z. + elseif lc =~? '"sv.*utf-\?8"' + call assert_equal(['a', 'A', 'o', 'O', 'p', 'P', 'ä', 'Ä', 'œ', 'œ', 'ô', 'Ô'], + \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) + endif endfunc func Test_sort_numeric() @@ -1223,6 +1242,58 @@ func Test_sort_cmd() \ }, \ ] + " With the following locales, the accentuated letters are ordered + " similarly to the non-accentuated letters... + let lc = execute('language collate') + if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"' + let tests += [ + \ { + \ 'name' : 'sort with locale', + \ 'cmd' : '%sort l', + \ 'input' : [ + \ 'A', + \ 'E', + \ 'O', + \ 'À', + \ 'È', + \ 'É', + \ 'Ô', + \ 'Œ', + \ 'Z', + \ 'a', + \ 'e', + \ 'o', + \ 'à', + \ 'è', + \ 'é', + \ 'ô', + \ 'œ', + \ 'z' + \ ], + \ 'expected' : [ + \ 'a', + \ 'A', + \ 'à', + \ 'À', + \ 'e', + \ 'E', + \ 'é', + \ 'É', + \ 'è', + \ 'È', + \ 'o', + \ 'O', + \ 'ô', + \ 'Ô', + \ 'œ', + \ 'Œ', + \ 'z', + \ 'Z' + \ ] + \ }, + \ ] + endif + for t in tests enew! call append(0, t.input) -- cgit From a83292685bc582744804a14f4fcb417502f40707 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Tue, 20 Apr 2021 00:52:22 +0100 Subject: vim-patch:8.2.1935: sort test fails on Mac Problem: Sort test fails on Mac. Solution: Disable the sort test with locale on Mac. https://github.com/vim/vim/commit/578f4cc7d0ce67101832b25cf77246fcd630e3c0 --- src/nvim/testdir/test_sort.vim | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src/nvim/testdir/test_sort.vim') diff --git a/src/nvim/testdir/test_sort.vim b/src/nvim/testdir/test_sort.vim index 278cbef01e..e4584a8eb7 100644 --- a/src/nvim/testdir/test_sort.vim +++ b/src/nvim/testdir/test_sort.vim @@ -20,17 +20,20 @@ func Test_sort_strings() call assert_equal(['A', 'a', 'o', 'O', 'p', 'P', 'Ä', 'Ô', 'ä', 'ô', 'œ', 'œ'], \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'i')) - let lc = execute('language collate') - " With the following locales, the accentuated letters are ordered - " similarly to the non-accentuated letters... - if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"' - call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'œ', 'p', 'P'], - \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) - " ... whereas with a Swedish locale, the accentuated letters are ordered - " after Z. - elseif lc =~? '"sv.*utf-\?8"' - call assert_equal(['a', 'A', 'o', 'O', 'p', 'P', 'ä', 'Ä', 'œ', 'œ', 'ô', 'Ô'], - \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) + " This does not appear to work correctly on Mac. + if !has('mac') + let lc = execute('language collate') + " With the following locales, the accentuated letters are ordered + " similarly to the non-accentuated letters... + if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"' + call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'œ', 'p', 'P'], + \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) + " ... whereas with a Swedish locale, the accentuated letters are ordered + " after Z. + elseif lc =~? '"sv.*utf-\?8"' + call assert_equal(['a', 'A', 'o', 'O', 'p', 'P', 'ä', 'Ä', 'œ', 'œ', 'ô', 'Ô'], + \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) + endif endif endfunc @@ -1243,9 +1246,10 @@ func Test_sort_cmd() \ ] " 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') - if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"' + if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"' && !has('mac') let tests += [ \ { \ 'name' : 'sort with locale', -- cgit From 8c55a16e7d9ad14df797d17802ab749e20b433c7 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Tue, 20 Apr 2021 00:59:25 +0100 Subject: vim-patch:8.2.1946: sort() with NULL string not tested MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: sort() with NULL string not tested. Solution: Add a test. use v:collate. (Dominique Pellé, closes vim/vim#7247) https://github.com/vim/vim/commit/35efa22ff2b98126363098db9304796b5624f97f --- src/nvim/testdir/test_sort.vim | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/nvim/testdir/test_sort.vim') diff --git a/src/nvim/testdir/test_sort.vim b/src/nvim/testdir/test_sort.vim index e4584a8eb7..3b1dc4ae1c 100644 --- a/src/nvim/testdir/test_sort.vim +++ b/src/nvim/testdir/test_sort.vim @@ -22,21 +22,25 @@ func Test_sort_strings() " This does not appear to work correctly on Mac. if !has('mac') - let lc = execute('language collate') " With the following locales, the accentuated letters are ordered " similarly to the non-accentuated letters... - if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"' + if v:collate =~? '^\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8$' call assert_equal(['a', 'A', 'ä', 'Ä', 'o', 'O', 'ô', 'Ô', 'œ', 'œ', 'p', 'P'], \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) " ... whereas with a Swedish locale, the accentuated letters are ordered " after Z. - elseif lc =~? '"sv.*utf-\?8"' + elseif v:collate =~? '^sv.*utf-\?8$' call assert_equal(['a', 'A', 'o', 'O', 'p', 'P', 'ä', 'Ä', 'œ', 'œ', 'ô', 'Ô'], \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) endif endif endfunc +func Test_sort_null_string() + " null strings are sorted as empty strings. + call assert_equal(['', 'a', 'b'], sort(['b', v:_null_string, 'a'])) +endfunc + func Test_sort_numeric() call assert_equal([1, 2, 3], sort([3, 2, 1], 'n')) call assert_equal([3, 13, 28], sort([13, 28, 3], 'n')) @@ -1248,8 +1252,7 @@ func Test_sort_cmd() " With the following locales, the accentuated letters are ordered " similarly to the non-accentuated letters. " This does not appear to work on Mac - let lc = execute('language collate') - if lc =~? '"\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8"' && !has('mac') + if v:collate =~? '^\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8$' && !has('mac') let tests += [ \ { \ 'name' : 'sort with locale', -- cgit From b5dbd156f91b8e4d0525cc9cf91d73f4825fbb23 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Tue, 20 Apr 2021 01:18:55 +0100 Subject: 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) https://github.com/vim/vim/commit/fefa6c347e2c7f01ed2b095084f4aa694ff72149 --- src/nvim/testdir/test_sort.vim | 164 +++++++++++++++++++++++++++-------------- 1 file changed, 109 insertions(+), 55 deletions(-) (limited to 'src/nvim/testdir/test_sort.vim') diff --git a/src/nvim/testdir/test_sort.vim b/src/nvim/testdir/test_sort.vim index 3b1dc4ae1c..5ed50c8d05 100644 --- a/src/nvim/testdir/test_sort.vim +++ b/src/nvim/testdir/test_sort.vim @@ -22,14 +22,18 @@ func Test_sort_strings() " This does not appear to work correctly on Mac. if !has('mac') - " With the following locales, the accentuated letters are ordered - " similarly to the non-accentuated letters... - if v:collate =~? '^\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8$' + 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')) - " ... whereas with a Swedish locale, the accentuated letters are ordered - " after Z. elseif v:collate =~? '^sv.*utf-\?8$' + " ... whereas with a Swedish locale, the accentuated letters are ordered + " after Z. call assert_equal(['a', 'A', 'o', 'O', 'p', 'P', 'ä', 'Ä', 'œ', 'œ', 'ô', 'Ô'], \ sort(['A', 'a', 'o', 'O', 'œ', 'œ', 'p', 'P', 'Ä', 'ä', 'ô', 'Ô'], 'l')) endif @@ -1249,56 +1253,106 @@ func Test_sort_cmd() \ }, \ ] - " With the following locales, the accentuated letters are ordered - " similarly to the non-accentuated letters. - " This does not appear to work on Mac - if v:collate =~? '^\(en\|es\|de\|fr\|it\|nl\).*\.utf-\?8$' && !has('mac') - let tests += [ - \ { - \ 'name' : 'sort with locale', - \ 'cmd' : '%sort l', - \ 'input' : [ - \ 'A', - \ 'E', - \ 'O', - \ 'À', - \ 'È', - \ 'É', - \ 'Ô', - \ 'Œ', - \ 'Z', - \ 'a', - \ 'e', - \ 'o', - \ 'à', - \ 'è', - \ 'é', - \ 'ô', - \ 'œ', - \ 'z' - \ ], - \ 'expected' : [ - \ 'a', - \ 'A', - \ 'à', - \ 'À', - \ 'e', - \ 'E', - \ 'é', - \ 'É', - \ 'è', - \ 'È', - \ 'o', - \ 'O', - \ 'ô', - \ 'Ô', - \ 'œ', - \ 'Œ', - \ 'z', - \ 'Z' - \ ] - \ }, - \ ] + " 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, + \ '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', + \ 'input' : [ + \ 'A', + \ 'E', + \ 'O', + \ 'À', + \ 'È', + \ 'É', + \ 'Ô', + \ 'Œ', + \ 'Z', + \ 'a', + \ 'e', + \ 'o', + \ 'à', + \ 'è', + \ 'é', + \ 'ô', + \ 'œ', + \ 'z' + \ ], + \ 'expected' : [ + \ 'a', + \ 'A', + \ 'à', + \ 'À', + \ 'e', + \ 'E', + \ 'é', + \ 'É', + \ 'è', + \ 'È', + \ 'o', + \ 'O', + \ 'ô', + \ 'Ô', + \ 'œ', + \ 'Œ', + \ 'z', + \ 'Z' + \ ] + \ }, + \ ] + endif endif for t in tests -- cgit 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/nvim/testdir/test_sort.vim') 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