forked from aniani/vim
patch 9.1.1051: tests: no support for env variables when running Vim in terminal
Problem: tests: no support for env variables when running Vim in
terminal
Solution: support the "env" argument in RunVimInTerminal(),
close swapfiles properly in test_termcodes,
use CheckFeature in test_termencoding
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -57,6 +57,7 @@ endfunc
|
||||
" "wait_for_ruler" - if zero then don't wait for ruler to show
|
||||
" "no_clean" - if non-zero then remove "--clean" from the command
|
||||
" "cmd" - run any other command, e.g. "xxd" (used in xxd test)
|
||||
" "env" - additional environment variables, e.g. $TERM variable
|
||||
func RunVimInTerminal(arguments, options)
|
||||
" If Vim doesn't exit a swap file remains, causing other tests to fail.
|
||||
" Remove it here.
|
||||
@@ -109,6 +110,10 @@ func RunVimInTerminal(arguments, options)
|
||||
|
||||
" Accept other options whose name starts with 'term_'.
|
||||
call extend(options, filter(copy(a:options), 'v:key =~# "^term_"'))
|
||||
" Accept the env dict
|
||||
if !empty(get(a:options, 'env', {}))
|
||||
let options.env = get(a:options, 'env')
|
||||
endif
|
||||
|
||||
let buf = term_start(cmd, options)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user