From 326ae7c8ceddd706106760b8ca672cdbfceda23b Mon Sep 17 00:00:00 2001 From: Michael Ennen Date: Thu, 19 May 2016 15:05:37 -0700 Subject: 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 --- src/nvim/testdir/Makefile | 1 + src/nvim/testdir/test_unlet.vim | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/nvim/testdir/test_unlet.vim (limited to 'src/nvim/testdir') 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 -- cgit