]> granicus.if.org Git - vim/commitdiff
patch 8.2.1296: some part of using 'smarcase' was not tested v8.2.1296
authorBram Moolenaar <Bram@vim.org>
Sun, 26 Jul 2020 11:27:16 +0000 (13:27 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 26 Jul 2020 11:27:16 +0000 (13:27 +0200)
Problem:    Some part of using 'smarcase' was not tested.
Solution:   Add more tests. (Dominique Pellé, closes #6538)

src/testdir/test_search.vim
src/version.c

index 93b68a78a3693c80bf84bec42d1f8c1bc015be0f..9769fb2625c7f253071b93f896d8926dcc45165e 100644 (file)
@@ -608,7 +608,7 @@ func Test_search_cmdline6()
 endfunc
 
 func Test_search_cmdline7()
-  " Test that an pressing <c-g> in an empty command line
+  " Test that pressing <c-g> in an empty command line
   " does not move the cursor
   CheckOption incsearch
 
@@ -1642,6 +1642,25 @@ func Test_search_smartcase()
 
   set ignorecase& smartcase&
   close!
+endfun
+
+" Test 'smartcase' with utf-8.
+func Test_search_smartcase_utf8()
+  new
+  let save_enc = &encoding
+  set encoding=utf8 ignorecase smartcase
+
+  call setline(1, 'Café cafÉ')
+  1s/café/x/g
+  call assert_equal('x x', getline(1))
+
+  call setline(1, 'Café cafÉ')
+  1s/cafÉ/x/g
+  call assert_equal('Café x', getline(1))
+
+  set ignorecase& smartcase&
+  let &encoding = save_enc
+  close!
 endfunc
 
 " Test searching past the end of a file
index fe9b7872094830a8fb2b305ac2249cfc6a39fdaa..6a5f19951e5e8923daf90e08007767c0d18cc453 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1296,
 /**/
     1295,
 /**/