vimspector/tests/utils.test.vim
Ben Jackson 30eec0d93c Fix variable substitution for multiple defaulted vars
The problem was that the python regex engine is strictly left-to-right,
so matching `[^}]|\\}` against \\}} meant that the `\\` was consumed by
the left of the `|`. The solution is to just switch them around.

Also add a way to run python tests from within vim, so we can actually
test this stuff.
2021-02-06 20:55:24 +00:00

28 lines
646 B
VimL

function! SetUp()
call vimspector#test#setup#SetUpWithMappings( v:none )
py3 import vim
py3 __import__( 'vimspector' )
endfunction
function! ClearDown()
call vimspector#test#setup#ClearDown()
endfunction
function! s:RunPyFile( file_name )
redir => py_output
try
let v:errmsg = ''
silent! execute 'py3file python/' .. a:file_name
finally
redir END
call TestLog( [ a:file_name .. ' output:' ] + split( py_output, '\n' ) )
endtry
if v:errmsg !=# ''
call assert_report( v:errmsg )
endif
endfunction
function! Test_ExpandReferencesInDict()
call s:RunPyFile( 'Test_ExpandReferencesInDict.py' )
endfunction