diff options
| author | Michael Ennen <mike.ennen@gmail.com> | 2016-05-19 15:05:37 -0700 |
|---|---|---|
| committer | Michael Ennen <mike.ennen@gmail.com> | 2016-06-09 12:27:28 -0700 |
| commit | 326ae7c8ceddd706106760b8ca672cdbfceda23b (patch) | |
| tree | 1c226b9c8b35b7ad1691c4c099c0efbe7bd68cd5 /src/nvim/testdir | |
| parent | e35562474803f369bdf7cea306640da3bef6cad3 (diff) | |
| download | rneovim-326ae7c8ceddd706106760b8ca672cdbfceda23b.tar.gz rneovim-326ae7c8ceddd706106760b8ca672cdbfceda23b.tar.bz2 rneovim-326ae7c8ceddd706106760b8ca672cdbfceda23b.zip | |
vim-patch:7.4.1051
Problem: Segfault when unletting "count".
Solution: Check for readonly and locked first. (Dominique Pelle)
Add a test.
https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/Makefile | 1 | ||||
| -rw-r--r-- | src/nvim/testdir/test_unlet.vim | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 4b2b150ef2..4c4b46e159 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -39,6 +39,7 @@ NEW_TESTS = \ test_menu.res \ test_syntax.res \ test_timers.res \ + test_unlet.res \ test_viml.res \ test_alot.res diff --git a/src/nvim/testdir/test_unlet.vim b/src/nvim/testdir/test_unlet.vim new file mode 100644 index 0000000000..f6705997a9 --- /dev/null +++ b/src/nvim/testdir/test_unlet.vim @@ -0,0 +1,26 @@ +" Tests for :unlet + +func Test_read_only() + try + " this caused a crash + unlet count + catch + call assert_true(v:exception =~ ':E795:') + endtry +endfunc + +func Test_existing() + let does_exist = 1 + call assert_true(exists('does_exist')) + unlet does_exist + call assert_false(exists('does_exist')) +endfunc + +func Test_not_existing() + unlet! does_not_exist + try + unlet does_not_exist + catch + call assert_true(v:exception =~ ':E108:') + endtry +endfunc |