diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2017-11-03 10:42:26 +0300 |
---|---|---|
committer | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2018-01-26 18:39:20 +0300 |
commit | 997fc8b13371fac89f8e445275c4aaad2afd37a4 (patch) | |
tree | 3b83a075d19930cadc49a6dfe3e874388cae04bc /test | |
parent | 660bfb3fb3e5f7ba92cbcac7e4f6b47097303a0f (diff) | |
download | rneovim-997fc8b13371fac89f8e445275c4aaad2afd37a4.tar.gz rneovim-997fc8b13371fac89f8e445275c4aaad2afd37a4.tar.bz2 rneovim-997fc8b13371fac89f8e445275c4aaad2afd37a4.zip |
Add tests
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/searchhl_spec.lua | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua index 950989aab2..9fe9c2e6bd 100644 --- a/test/functional/ui/searchhl_spec.lua +++ b/test/functional/ui/searchhl_spec.lua @@ -107,6 +107,29 @@ describe('search highlighting', function() /li^ | ]]) + -- check that consecutive matches are caught by C-g/C-t + feed("<C-g>") + screen:expect([[ + the first {2:li}ne | + in a {3:li}ttle file | + | + {1:~ }| + {1:~ }| + {1:~ }| + /li^ | + ]]) + + feed("<C-t>") + screen:expect([[ + the first {3:li}ne | + in a {2:li}ttle file | + | + {1:~ }| + {1:~ }| + {1:~ }| + /li^ | + ]]) + feed("t") screen:expect([[ the first line | @@ -163,6 +186,63 @@ describe('search highlighting', function() {1:~ }| | ]]) + + -- cancelling inc search restores the hl state + feed(':noh<cr>') + screen:expect([[ + the first line | + in a ^little file | + | + {1:~ }| + {1:~ }| + {1:~ }| + :noh | + ]]) + + feed('/first') + screen:expect([[ + the {3:first} line | + in a little file | + | + {1:~ }| + {1:~ }| + {1:~ }| + /first^ | + ]]) + feed('<esc>') + screen:expect([[ + the first line | + in a ^little file | + | + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]) + + -- test that pressing C-g in an empty command line does not move the cursor + feed('/<C-g>') + screen:expect([[ + the first line | + in a little file | + | + {1:~ }| + {1:~ }| + {1:~ }| + /^ | + ]]) + + -- same, for C-t + feed('<ESC>/<C-t>') + screen:expect([[ + the first line | + in a little file | + | + {1:~ }| + {1:~ }| + {1:~ }| + /^ | + ]]) end) it('works with incsearch and offset', function() |