aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-06-26 10:19:09 -0400
committerGitHub <noreply@github.com>2021-06-26 10:19:09 -0400
commit20dc3f1989dca8aa9b64970f3799e4f48ac080c8 (patch)
treef851d279fd6730e55e7c751dc319d35286581476 /src/nvim/testdir
parentad9c2c069a96b694956fcae3614c637aeb5fa6fe (diff)
downloadrneovim-20dc3f1989dca8aa9b64970f3799e4f48ac080c8.tar.gz
rneovim-20dc3f1989dca8aa9b64970f3799e4f48ac080c8.tar.bz2
rneovim-20dc3f1989dca8aa9b64970f3799e4f48ac080c8.zip
vim-patch:8.1.0897: can modify a:000 when using a reference (#14902)
Problem: Can modify a:000 when using a reference. Solution: Make check for locked variable stricter. (Ozaki Kiichi, closes vim/vim#3930) https://github.com/vim/vim/commit/05c00c038bc16e862e17f9e5c8d5a72af6cf7788
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_let.vim10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_let.vim b/src/nvim/testdir/test_let.vim
index a5cbd8f6a6..6cb736a38a 100644
--- a/src/nvim/testdir/test_let.vim
+++ b/src/nvim/testdir/test_let.vim
@@ -126,11 +126,16 @@ endfunction
func s:set_varg7(...) abort
let b = a:000
- call add(b, 1)
+ let b += [1]
endfunction
func s:set_varg8(...) abort
let b = a:000
+ call add(b, 1)
+endfunction
+
+func s:set_varg9(...) abort
+ let b = a:000
let b[0][0] = 1
endfunction
@@ -142,7 +147,8 @@ func Test_let_varg_fail()
call s:set_varg5([0])
call assert_fails('call s:set_varg6(1)', 'E742:')
call assert_fails('call s:set_varg7(1)', 'E742:')
- call s:set_varg8([0])
+ call assert_fails('call s:set_varg8(1)', 'E742:')
+ call s:set_varg9([0])
endfunction
func Test_let_utf8_environment()