summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-26 13:27:16 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-26 13:27:16 +0200
commitd66cdcd43a598825add743bc95642cd8ed705252 (patch)
treee022a883f1420b383d64ec8a74ee77c8769009e8 /src/testdir
parent7d40b8a532fa2ce768f200ab118870d17875a7fe (diff)
patch 8.2.1296: some part of using 'smarcase' was not testedv8.2.1296
Problem: Some part of using 'smarcase' was not tested. Solution: Add more tests. (Dominique Pellé, closes #6538)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_search.vim21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index 93b68a78a3..9769fb2625 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -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