]> granicus.if.org Git - vim/commitdiff
patch 8.2.1935: sort test fails on Mac v8.2.1935
authorBram Moolenaar <Bram@vim.org>
Sun, 1 Nov 2020 16:19:07 +0000 (17:19 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 1 Nov 2020 16:19:07 +0000 (17:19 +0100)
Problem:    Sort test fails on Mac.
Solution:   Disable the sort test with locale on Mac.

src/testdir/test_sort.vim
src/version.c

index 93190a940ceb2da75c7cb376546d6d31c653ec0e..244678ea9f643a6730bf403d2d0f92de23c48c38 100644 (file)
@@ -22,17 +22,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
 
@@ -1224,9 +1227,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',
index a0c3857b8b22f25c10dbf2cd8dc528ebbcfd9d2d..ed74a497fedb5bded99d07f3a2fe5aee0f3b3a5d 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1935,
 /**/
     1934,
 /**/