diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-06-15 08:05:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-15 08:05:26 +0800 |
commit | 78d77c03de579845fcaa761e7339c93fcd74efb2 (patch) | |
tree | 07372ce021e0aa7499f56d47a4391326aae05fe8 /test/old/testdir/test_options.vim | |
parent | cf6cffda89ad0b22de0ddd4ca7abcb714da812d0 (diff) | |
download | rneovim-78d77c03de579845fcaa761e7339c93fcd74efb2.tar.gz rneovim-78d77c03de579845fcaa761e7339c93fcd74efb2.tar.bz2 rneovim-78d77c03de579845fcaa761e7339c93fcd74efb2.zip |
vim-patch:9.0.1631: passing wrong variable type to option gives multiple errors (#24026)
Problem: Passing a wrong variable type to an option gives multiple errors.
Solution: Bail out early on failure. (closes vim/vim#12504)
https://github.com/vim/vim/commit/4c7cb372c17a84c8a35254d93eb37cb854cd39da
Diffstat (limited to 'test/old/testdir/test_options.vim')
-rw-r--r-- | test/old/testdir/test_options.vim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/old/testdir/test_options.vim b/test/old/testdir/test_options.vim index ada44e5eed..5a30fbbb16 100644 --- a/test/old/testdir/test_options.vim +++ b/test/old/testdir/test_options.vim @@ -380,7 +380,7 @@ func Test_set_completion() call assert_equal('"set filetype=' .. getcompletion('a*', 'filetype')->join(), @:) endfunc -func Test_set_errors() +func Test_set_option_errors() call assert_fails('set scroll=-1', 'E49:') call assert_fails('set backupcopy=', 'E474:') call assert_fails('set regexpengine=3', 'E474:') @@ -482,7 +482,7 @@ func Test_set_errors() if has('python') || has('python3') call assert_fails('set pyxversion=6', 'E474:') endif - call assert_fails("let &tabstop='ab'", 'E521:') + call assert_fails("let &tabstop='ab'", ['E521:', 'E521:']) call assert_fails('set spellcapcheck=%\\(', 'E54:') call assert_fails('set sessionoptions=curdir,sesdir', 'E474:') call assert_fails('set foldmarker={{{,', 'E474:') @@ -506,6 +506,12 @@ func Test_set_errors() " call assert_fails('set t_#-&', 'E522:') call assert_fails('let &formatoptions = "?"', 'E539:') call assert_fails('call setbufvar("", "&formatoptions", "?")', 'E539:') + call assert_fails('call setwinvar(0, "&scrolloff", [])', ['E745:', 'E745:']) + call assert_fails('call setwinvar(0, "&list", [])', ['E745:', 'E745:']) + call assert_fails('call setwinvar(0, "&listchars", [])', ['E730:', 'E730:']) + call assert_fails('call setwinvar(0, "&nosuchoption", 0)', ['E355:', 'E355:']) + call assert_fails('call setwinvar(0, "&nosuchoption", "")', ['E355:', 'E355:']) + call assert_fails('call setwinvar(0, "&nosuchoption", [])', ['E355:', 'E355:']) endfunc func CheckWasSet(name) |