diff options
author | Jaskaran Singh <jaskaransingh7654321@gmail.com> | 2019-06-08 18:23:32 +0530 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-06-08 14:53:32 +0200 |
commit | d646fe73acb0acbe12aa42e065c3e0dc5234b8a7 (patch) | |
tree | 54ef4440341051976825f2bb7c2fea0ba2c3ba17 /src | |
parent | d486ea37b289ba5a3d6a27af575516da22b2e10b (diff) | |
download | rneovim-d646fe73acb0acbe12aa42e065c3e0dc5234b8a7.tar.gz rneovim-d646fe73acb0acbe12aa42e065c3e0dc5234b8a7.tar.bz2 rneovim-d646fe73acb0acbe12aa42e065c3e0dc5234b8a7.zip |
vim-patch:8.1.1199: no test for :abclear #9936
Problem: No test for :abclear.
Solution: Add a test. (Dominique Pelle, closes vim/vim#4292)
https://github.com/vim/vim/commit/8485be4e49ed6c157d7349920992643fd1ab5c3b
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_mapping.vim | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 67f07ff6de..84a118aef2 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -15,6 +15,49 @@ func Test_abbreviation() set nomodified endfunc +func Test_abclear() + abbrev foo foobar + iabbrev fooi foobari + cabbrev fooc foobarc + call assert_equal("\n\nc fooc foobarc\ni fooi foobari\n! foo foobar", execute('abbrev')) + + iabclear + call assert_equal("\n\nc fooc foobarc\nc foo foobar", execute('abbrev')) + abbrev foo foobar + iabbrev fooi foobari + + cabclear + call assert_equal("\n\ni fooi foobari\ni foo foobar", execute('abbrev')) + abbrev foo foobar + cabbrev fooc foobarc + + abclear + call assert_equal("\n\nNo abbreviation found", execute('abbrev')) +endfunc + +func Test_abclear_buffer() + abbrev foo foobar + new X1 + abbrev <buffer> foo1 foobar1 + new X2 + abbrev <buffer> foo2 foobar2 + + call assert_equal("\n\n! foo2 @foobar2\n! foo foobar", execute('abbrev')) + + abclear <buffer> + call assert_equal("\n\n! foo foobar", execute('abbrev')) + + b X1 + call assert_equal("\n\n! foo1 @foobar1\n! foo foobar", execute('abbrev')) + abclear <buffer> + call assert_equal("\n\n! foo foobar", execute('abbrev')) + + abclear + call assert_equal("\n\nNo abbreviation found", execute('abbrev')) + + %bwipe +endfunc + func Test_map_ctrl_c_insert() " mapping of ctrl-c in Insert mode set cpo-=< cpo-=k |