mirror of
https://github.com/neovim/neovim.git
synced 2026-08-28 10:01:49 +00:00
vim-patch:7.4.1051
Problem: Segfault when unletting "count".
Solution: Check for readonly and locked first. (Dominique Pelle)
Add a test.
af8af8bfac
This commit is contained in:
26
src/nvim/testdir/test_unlet.vim
Normal file
26
src/nvim/testdir/test_unlet.vim
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user