aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorMichael Ennen <mike.ennen@gmail.com>2016-05-19 15:05:37 -0700
committerMichael Ennen <mike.ennen@gmail.com>2016-06-09 12:27:28 -0700
commit326ae7c8ceddd706106760b8ca672cdbfceda23b (patch)
tree1c226b9c8b35b7ad1691c4c099c0efbe7bd68cd5 /src/nvim/testdir
parente35562474803f369bdf7cea306640da3bef6cad3 (diff)
downloadrneovim-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/Makefile1
-rw-r--r--src/nvim/testdir/test_unlet.vim26
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