diff options
Diffstat (limited to 'src/testdir/test_options.vim')
-rw-r--r-- | src/testdir/test_options.vim | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 3a4335650..65600eea9 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -296,20 +296,48 @@ func Test_set_errors() call assert_fails('set t_foo=', 'E846:') endfunc +func CheckWasSet(name) + let verb_cm = execute('verbose set ' .. a:name .. '?') + call assert_match('Last set from.*test_options.vim', verb_cm) +endfunc +func CheckWasNotSet(name) + let verb_cm = execute('verbose set ' .. a:name .. '?') + call assert_notmatch('Last set from', verb_cm) +endfunc + " Must be executed before other tests that set 'term'. func Test_000_term_option_verbose() CheckNotGui - let verb_cm = execute('verbose set t_cm') - call assert_notmatch('Last set from', verb_cm) + call CheckWasNotSet('t_cm') let term_save = &term set term=ansi - let verb_cm = execute('verbose set t_cm') - call assert_match('Last set from.*test_options.vim', verb_cm) + call CheckWasSet('t_cm') let &term = term_save endfunc +func Test_copy_context() + setlocal list + call CheckWasSet('list') + split + call CheckWasSet('list') + quit + setlocal nolist + + set ai + call CheckWasSet('ai') + set filetype=perl + call CheckWasSet('filetype') + set fo=tcroq + call CheckWasSet('fo') + + split Xsomebuf + call CheckWasSet('ai') + call CheckWasNotSet('filetype') + call CheckWasSet('fo') +endfunc + func Test_set_ttytype() CheckUnix CheckNotGui |