diff src/testdir/test_search.vim @ 20128:0b35a7ffceb2 v8.2.0619

patch 8.2.0619: null dict is not handled like an empty dict Commit: https://github.com/vim/vim/commit/ea04a6e8baff2f27da7cdd54bf70a5525994f76d Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 23 13:38:02 2020 +0200 patch 8.2.0619: null dict is not handled like an empty dict Problem: Null dict is not handled like an empty dict. Solution: Fix the code and add tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5968)
author Bram Moolenaar <Bram@vim.org>
date Thu, 23 Apr 2020 13:45:04 +0200
parents 9f5758ee0b10
children 2dd1ac2c48f4
line wrap: on
line diff
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -1617,4 +1617,35 @@ func Test_search_in_visual_area()
   close!
 endfunc
 
+" Test for searching with 'smartcase' and 'ignorecase'
+func Test_search_smartcase()
+  new
+  call setline(1, ['', 'Hello'])
+  set noignorecase nosmartcase
+  call assert_fails('exe "normal /\\a\\_.\\(.*\\)O\<CR>"', 'E486:')
+
+  set ignorecase nosmartcase
+  exe "normal /\\a\\_.\\(.*\\)O\<CR>"
+  call assert_equal([2, 1], [line('.'), col('.')])
+
+  call cursor(1, 1)
+  set ignorecase smartcase
+  call assert_fails('exe "normal /\\a\\_.\\(.*\\)O\<CR>"', 'E486:')
+
+  exe "normal /\\a\\_.\\(.*\\)o\<CR>"
+  call assert_equal([2, 1], [line('.'), col('.')])
+
+  set ignorecase& smartcase&
+  close!
+endfunc
+
+" Test searching past the end of a file
+func Test_search_past_eof()
+  new
+  call setline(1, ['Line'])
+  exe "normal /\\n\\zs\<CR>"
+  call assert_equal([1, 4], [line('.'), col('.')])
+  close!
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab