Use YCM python style
This commit is contained in:
parent
a56bee7b0a
commit
8052484cc7
14 changed files with 82 additions and 49 deletions
3
.vintrc.yml
Normal file
3
.vintrc.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
cmdargs:
|
||||||
|
color: true
|
||||||
|
severity: style_problem
|
||||||
|
|
@ -72,6 +72,29 @@ For more infomration on the test framework, see
|
||||||
[this article](https://vimways.org/2019/a-test-to-attest-to/), authored by the
|
[this article](https://vimways.org/2019/a-test-to-attest-to/), authored by the
|
||||||
Vimspector creator.
|
Vimspector creator.
|
||||||
|
|
||||||
|
### Code Style
|
||||||
|
|
||||||
|
The code style of the Python code is "YCM" style, because that's how I like it.
|
||||||
|
[`flake8`][] is used to check for certain errors and code style.
|
||||||
|
|
||||||
|
The code style of the Vimscript is largely the same, and it is linted by
|
||||||
|
[`vint`][].
|
||||||
|
|
||||||
|
To run them:
|
||||||
|
|
||||||
|
* (optional) Create and activate a virtual env:
|
||||||
|
`python3 -m venv venv ; source venv/bin/activate`
|
||||||
|
* Install the development dependencies: `pip install -r dev_requirements.txt`
|
||||||
|
* Run `flake8`: `flake8 python3/ *.py`
|
||||||
|
* Run `vint`: `vint autoload/ plugin/ tests/`
|
||||||
|
|
||||||
|
They're also run by CI, so please check for lint failures. The canonical
|
||||||
|
definition of the command to run is the command run in CI, i.e. in
|
||||||
|
`azure-pipelines.yml`.
|
||||||
|
|
||||||
# Code of conduct
|
# Code of conduct
|
||||||
|
|
||||||
Please see [code of conduct](CODE_OF_CONDUCT.md).
|
Please see [code of conduct](CODE_OF_CONDUCT.md).
|
||||||
|
|
||||||
|
[vint]: https://github.com/Vimjas/vint
|
||||||
|
[flake8]: https://flake8.pycqa.org/en/latest/
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ stages:
|
||||||
- bash: pip3 install -r dev_requirements.txt
|
- bash: pip3 install -r dev_requirements.txt
|
||||||
displayName: "Install requirements"
|
displayName: "Install requirements"
|
||||||
|
|
||||||
- bash: $HOME/.local/bin/vint autoload/ plugin/
|
- bash: $HOME/.local/bin/vint autoload/ plugin/ tests/
|
||||||
displayName: "Run vint"
|
displayName: "Run vint"
|
||||||
|
|
||||||
- job: 'linux'
|
- job: 'linux'
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
flake8==3.7.7
|
flake8==3.7.7
|
||||||
vim-vint==0.3.21
|
vim-vint==0.3.21
|
||||||
|
flake8-comprehensions
|
||||||
|
flake8-ycm>= 0.1.0
|
||||||
|
|
|
||||||
|
|
@ -529,7 +529,7 @@ def DownloadFileTo( url,
|
||||||
destination,
|
destination,
|
||||||
file_name = None,
|
file_name = None,
|
||||||
checksum = None,
|
checksum = None,
|
||||||
sslcheck = True):
|
sslcheck = True ):
|
||||||
if not file_name:
|
if not file_name:
|
||||||
file_name = url.split( '/' )[ -1 ]
|
file_name = url.split( '/' )[ -1 ]
|
||||||
|
|
||||||
|
|
@ -759,7 +759,7 @@ for name, gadget in GADGETS.items():
|
||||||
destination,
|
destination,
|
||||||
file_name = gadget[ 'download' ].get( 'target' ),
|
file_name = gadget[ 'download' ].get( 'target' ),
|
||||||
checksum = v.get( 'checksum' ),
|
checksum = v.get( 'checksum' ),
|
||||||
sslcheck = not verify_cert_off)
|
sslcheck = not verify_cert_off )
|
||||||
root = os.path.join( destination, 'root' )
|
root = os.path.join( destination, 'root' )
|
||||||
ExtractZipTo( file_path,
|
ExtractZipTo( file_path,
|
||||||
root,
|
root,
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ class DebugSession( object ):
|
||||||
else:
|
else:
|
||||||
configuration_name = utils.SelectFromList(
|
configuration_name = utils.SelectFromList(
|
||||||
'Which launch configuration?',
|
'Which launch configuration?',
|
||||||
sorted( list( configurations.keys() ) ) )
|
sorted( configurations.keys() ) )
|
||||||
|
|
||||||
if not configuration_name or configuration_name not in configurations:
|
if not configuration_name or configuration_name not in configurations:
|
||||||
return
|
return
|
||||||
|
|
@ -259,13 +259,13 @@ class DebugSession( object ):
|
||||||
def IfConnected( fct ):
|
def IfConnected( fct ):
|
||||||
"""Decorator, call fct if self._connected else echo warning"""
|
"""Decorator, call fct if self._connected else echo warning"""
|
||||||
@functools.wraps( fct )
|
@functools.wraps( fct )
|
||||||
def wrapper(self, *args, **kwargs):
|
def wrapper( self, *args, **kwargs ):
|
||||||
if not self._connection:
|
if not self._connection:
|
||||||
utils.UserMessage(
|
utils.UserMessage(
|
||||||
'Vimspector not connected, start a debug session first',
|
'Vimspector not connected, start a debug session first',
|
||||||
persist=True, error=True )
|
persist=True, error=True )
|
||||||
return
|
return
|
||||||
return fct(self, *args, **kwargs)
|
return fct( self, *args, **kwargs )
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
def OnChannelData( self, data ):
|
def OnChannelData( self, data ):
|
||||||
|
|
|
||||||
|
|
@ -210,4 +210,4 @@ class OutputView( object ):
|
||||||
'*' if tab_buffer.flag else '' ) )
|
'*' if tab_buffer.flag else '' ) )
|
||||||
|
|
||||||
def GetCategories( self ):
|
def GetCategories( self ):
|
||||||
return [ category for category in self._buffers.keys() ]
|
return list( self._buffers.keys() )
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,7 @@ def Escape( msg ):
|
||||||
return msg.replace( "'", "''" )
|
return msg.replace( "'", "''" )
|
||||||
|
|
||||||
|
|
||||||
def UserMessage( msg, persist=False, error=False):
|
def UserMessage( msg, persist=False, error=False ):
|
||||||
if persist:
|
if persist:
|
||||||
_logger.warning( 'User Msg: ' + msg )
|
_logger.warning( 'User Msg: ' + msg )
|
||||||
else:
|
else:
|
||||||
|
|
@ -242,11 +242,11 @@ def UserMessage( msg, persist=False, error=False):
|
||||||
vim.command( 'redraw' )
|
vim.command( 'redraw' )
|
||||||
try:
|
try:
|
||||||
if error:
|
if error:
|
||||||
vim.command("echohl WarningMsg")
|
vim.command( "echohl WarningMsg" )
|
||||||
for line in msg.split( '\n' ):
|
for line in msg.split( '\n' ):
|
||||||
vim.command( "{0} '{1}'".format( cmd, Escape( line ) ) )
|
vim.command( "{0} '{1}'".format( cmd, Escape( line ) ) )
|
||||||
finally:
|
finally:
|
||||||
vim.command('echohl None') if error else None
|
vim.command( 'echohl None' ) if error else None
|
||||||
vim.command( 'redraw' )
|
vim.command( 'redraw' )
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -324,7 +324,7 @@ def SetBufferContents( buf, lines, modified=False ):
|
||||||
if not isinstance( lines, list ):
|
if not isinstance( lines, list ):
|
||||||
lines = lines.splitlines()
|
lines = lines.splitlines()
|
||||||
|
|
||||||
buf[:] = lines
|
buf[ : ] = lines
|
||||||
finally:
|
finally:
|
||||||
buf.options[ 'modified' ] = modified
|
buf.options[ 'modified' ] = modified
|
||||||
|
|
||||||
|
|
@ -347,7 +347,7 @@ def ExpandReferencesInObject( obj, mapping, user_choices ):
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
|
||||||
def ExpandReferencesInString( orig_s, mapping, user_choices):
|
def ExpandReferencesInString( orig_s, mapping, user_choices ):
|
||||||
s = os.path.expanduser( orig_s )
|
s = os.path.expanduser( orig_s )
|
||||||
s = os.path.expandvars( s )
|
s = os.path.expandvars( s )
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,7 @@ function! Test_Insert_Code_Above_Breakpoint()
|
||||||
|
|
||||||
" CHeck that we break at the right point
|
" CHeck that we break at the right point
|
||||||
call setpos( '.', [ 0, 1, 1 ] )
|
call setpos( '.', [ 0, 1, 1 ] )
|
||||||
call vimspector#LaunchWithSettings( { "configuration": "run" } )
|
call vimspector#LaunchWithSettings( { 'configuration': 'run' } )
|
||||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 26, 1 )
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 26, 1 )
|
||||||
call vimspector#Reset()
|
call vimspector#Reset()
|
||||||
call vimspector#test#setup#WaitForReset()
|
call vimspector#test#setup#WaitForReset()
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ function! Test_Python_Simple()
|
||||||
call setpos( '.', [ 0, 1, 1 ] )
|
call setpos( '.', [ 0, 1, 1 ] )
|
||||||
|
|
||||||
" Here we go. Start Debugging
|
" Here we go. Start Debugging
|
||||||
call vimspector#LaunchWithSettings( { "configuration": "run" } )
|
call vimspector#LaunchWithSettings( { 'configuration': 'run' } )
|
||||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 6, 1 )
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 6, 1 )
|
||||||
|
|
||||||
" Step
|
" Step
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ endif
|
||||||
func RunVimInTerminal(arguments, options)
|
func RunVimInTerminal(arguments, options)
|
||||||
" If Vim doesn't exit a swap file remains, causing other tests to fail.
|
" If Vim doesn't exit a swap file remains, causing other tests to fail.
|
||||||
" Remove it here.
|
" Remove it here.
|
||||||
call delete(".swp")
|
call delete('.swp')
|
||||||
|
|
||||||
if exists('$COLORFGBG')
|
if exists('$COLORFGBG')
|
||||||
" Clear $COLORFGBG to avoid 'background' being set to "dark", which will
|
" Clear $COLORFGBG to avoid 'background' being set to "dark", which will
|
||||||
|
|
@ -61,7 +61,7 @@ func RunVimInTerminal(arguments, options)
|
||||||
\ 'term_rows': rows,
|
\ 'term_rows': rows,
|
||||||
\ 'term_cols': cols,
|
\ 'term_cols': cols,
|
||||||
\ })
|
\ })
|
||||||
if &termwinsize == ''
|
if &termwinsize ==# ''
|
||||||
" in the GUI we may end up with a different size, try to set it.
|
" in the GUI we may end up with a different size, try to set it.
|
||||||
if term_getsize(buf) != [rows, cols]
|
if term_getsize(buf) != [rows, cols]
|
||||||
call term_setsize(buf, rows, cols)
|
call term_setsize(buf, rows, cols)
|
||||||
|
|
@ -80,7 +80,7 @@ func RunVimInTerminal(arguments, options)
|
||||||
call WaitFor({-> len(term_getline(buf, rows)) >= cols - 1 || len(term_getline(buf, rows - statusoff)) >= cols - 1})
|
call WaitFor({-> len(term_getline(buf, rows)) >= cols - 1 || len(term_getline(buf, rows - statusoff)) >= cols - 1})
|
||||||
catch /timed out after/
|
catch /timed out after/
|
||||||
let lines = map(range(1, rows), {key, val -> term_getline(buf, val)})
|
let lines = map(range(1, rows), {key, val -> term_getline(buf, val)})
|
||||||
call assert_report('RunVimInTerminal() failed, screen contents: ' . join(lines, "<NL>"))
|
call assert_report('RunVimInTerminal() failed, screen contents: ' . join(lines, '<NL>'))
|
||||||
endtry
|
endtry
|
||||||
|
|
||||||
return buf
|
return buf
|
||||||
|
|
@ -88,7 +88,7 @@ endfunc
|
||||||
|
|
||||||
" Stop a Vim running in terminal buffer "buf".
|
" Stop a Vim running in terminal buffer "buf".
|
||||||
func StopVimInTerminal(buf)
|
func StopVimInTerminal(buf)
|
||||||
call assert_equal("running", term_getstatus(a:buf))
|
call assert_equal('running', term_getstatus(a:buf))
|
||||||
|
|
||||||
" CTRL-O : works both in Normal mode and Insert mode to start a command line.
|
" CTRL-O : works both in Normal mode and Insert mode to start a command line.
|
||||||
" In Command-line it's inserted, the CTRL-U removes it again.
|
" In Command-line it's inserted, the CTRL-U removes it again.
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ endfunc
|
||||||
func RunCommand(cmd)
|
func RunCommand(cmd)
|
||||||
let job = 0
|
let job = 0
|
||||||
if has('job')
|
if has('job')
|
||||||
let job = job_start(a:cmd, {"stoponexit": "hup"})
|
let job = job_start(a:cmd, {'stoponexit': 'hup'})
|
||||||
call job_setoptions(job, {"stoponexit": "kill"})
|
call job_setoptions(job, {'stoponexit': 'kill'})
|
||||||
elseif has('win32')
|
elseif has('win32')
|
||||||
exe 'silent !start cmd /c start "test_channel" ' . a:cmd
|
exe 'silent !start cmd /c start "test_channel" ' . a:cmd
|
||||||
else
|
else
|
||||||
|
|
@ -53,7 +53,7 @@ func GetPort()
|
||||||
" with 200 it sometimes failed
|
" with 200 it sometimes failed
|
||||||
for i in range(400)
|
for i in range(400)
|
||||||
try
|
try
|
||||||
let l = readfile("Xportnr")
|
let l = readfile('Xportnr')
|
||||||
catch
|
catch
|
||||||
endtry
|
endtry
|
||||||
if len(l) >= 1
|
if len(l) >= 1
|
||||||
|
|
@ -61,7 +61,7 @@ func GetPort()
|
||||||
endif
|
endif
|
||||||
sleep 10m
|
sleep 10m
|
||||||
endfor
|
endfor
|
||||||
call delete("Xportnr")
|
call delete('Xportnr')
|
||||||
|
|
||||||
if len(l) == 0
|
if len(l) == 0
|
||||||
" Can't make the connection, give up.
|
" Can't make the connection, give up.
|
||||||
|
|
@ -74,14 +74,14 @@ endfunc
|
||||||
" Always kills the server before returning.
|
" Always kills the server before returning.
|
||||||
func RunServer(cmd, testfunc, args)
|
func RunServer(cmd, testfunc, args)
|
||||||
" The Python program writes the port number in Xportnr.
|
" The Python program writes the port number in Xportnr.
|
||||||
call delete("Xportnr")
|
call delete('Xportnr')
|
||||||
|
|
||||||
if len(a:args) == 1
|
if len(a:args) == 1
|
||||||
let arg = ' ' . a:args[0]
|
let arg = ' ' . a:args[0]
|
||||||
else
|
else
|
||||||
let arg = ''
|
let arg = ''
|
||||||
endif
|
endif
|
||||||
let pycmd = s:python . " " . a:cmd . arg
|
let pycmd = s:python . ' ' . a:cmd . arg
|
||||||
|
|
||||||
try
|
try
|
||||||
let g:currentJob = RunCommand(pycmd)
|
let g:currentJob = RunCommand(pycmd)
|
||||||
|
|
@ -108,10 +108,10 @@ func s:kill_server(cmd)
|
||||||
unlet g:currentJob
|
unlet g:currentJob
|
||||||
endif
|
endif
|
||||||
elseif has('win32')
|
elseif has('win32')
|
||||||
let cmd = substitute(a:cmd, ".py", '', '')
|
let cmd = substitute(a:cmd, '.py', '', '')
|
||||||
call system('taskkill /IM ' . s:python . ' /T /F /FI "WINDOWTITLE eq ' . cmd . '"')
|
call system('taskkill /IM ' . s:python . ' /T /F /FI "WINDOWTITLE eq ' . cmd . '"')
|
||||||
else
|
else
|
||||||
call system("pkill -f " . a:cmd)
|
call system('pkill -f ' . a:cmd)
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|
@ -253,7 +253,7 @@ func GetVimCommand(...)
|
||||||
" "vimcmd" file, including environment options.
|
" "vimcmd" file, including environment options.
|
||||||
" Other Makefiles just write the executable in the first line, so fall back
|
" Other Makefiles just write the executable in the first line, so fall back
|
||||||
" to that if there is no second line or it is empty.
|
" to that if there is no second line or it is empty.
|
||||||
if len(lines) > 1 && lines[1] != ''
|
if len(lines) > 1 && lines[1] !=# ''
|
||||||
let cmd = lines[1]
|
let cmd = lines[1]
|
||||||
else
|
else
|
||||||
let cmd = lines[0]
|
let cmd = lines[0]
|
||||||
|
|
@ -267,7 +267,7 @@ func GetVimCommand(...)
|
||||||
let cmd = substitute(cmd, 'VIMRUNTIME=.*VIMRUNTIME;', '', '')
|
let cmd = substitute(cmd, 'VIMRUNTIME=.*VIMRUNTIME;', '', '')
|
||||||
|
|
||||||
" If using valgrind, make sure every run uses a different log file.
|
" If using valgrind, make sure every run uses a different log file.
|
||||||
if cmd =~ 'valgrind.*--log-file='
|
if cmd =~# 'valgrind.*--log-file='
|
||||||
let cmd = substitute(cmd, '--log-file=\(^\s*\)', '--log-file=\1.' . g:valgrind_cnt, '')
|
let cmd = substitute(cmd, '--log-file=\(^\s*\)', '--log-file=\1.' . g:valgrind_cnt, '')
|
||||||
let g:valgrind_cnt += 1
|
let g:valgrind_cnt += 1
|
||||||
endif
|
endif
|
||||||
|
|
@ -308,7 +308,7 @@ func RunVimPiped(before, after, arguments, pipecmd)
|
||||||
let args .= ' -S Xafter.vim'
|
let args .= ' -S Xafter.vim'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
exe "silent !" . a:pipecmd . cmd . args . ' ' . a:arguments
|
exe 'silent !' . a:pipecmd . cmd . args . ' ' . a:arguments
|
||||||
|
|
||||||
if len(a:before) > 0
|
if len(a:before) > 0
|
||||||
call delete('Xbefore.vim')
|
call delete('Xbefore.vim')
|
||||||
|
|
@ -320,7 +320,7 @@ func RunVimPiped(before, after, arguments, pipecmd)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func CanRunGui()
|
func CanRunGui()
|
||||||
return has('gui') && ($DISPLAY != "" || has('gui_running'))
|
return has('gui') && ($DISPLAY !=# '' || has('gui_running'))
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func WorkingClipboard()
|
func WorkingClipboard()
|
||||||
|
|
@ -328,7 +328,7 @@ func WorkingClipboard()
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
if has('x11')
|
if has('x11')
|
||||||
return $DISPLAY != ""
|
return $DISPLAY !=# ''
|
||||||
endif
|
endif
|
||||||
return 1
|
return 1
|
||||||
endfunc
|
endfunc
|
||||||
|
|
|
||||||
|
|
@ -36,16 +36,18 @@
|
||||||
let s:single_test_timeout = 60000
|
let s:single_test_timeout = 60000
|
||||||
|
|
||||||
" Restrict the runtimepath to the exact minimum needed for testing
|
" Restrict the runtimepath to the exact minimum needed for testing
|
||||||
set rtp=$PWD/lib,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after
|
set runtimepath=$PWD/lib,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after
|
||||||
if has('packages')
|
if has('packages')
|
||||||
let &packpath = &rtp
|
let &packpath = &runtimepath
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call ch_logfile( 'debuglog', 'w' )
|
call ch_logfile( 'debuglog', 'w' )
|
||||||
|
|
||||||
" For consistency run all tests with 'nocompatible' set.
|
" For consistency run all tests with 'nocompatible' set.
|
||||||
" This also enables use of line continuation.
|
" This also enables use of line continuation.
|
||||||
set nocp
|
" vint: -ProhibitSetNoCompatible
|
||||||
|
set nocompatible
|
||||||
|
" vint: +ProhibitSetNoCompatible
|
||||||
|
|
||||||
" Use utf-8 by default, instead of whatever the system default happens to be.
|
" Use utf-8 by default, instead of whatever the system default happens to be.
|
||||||
" Individual tests can overrule this at the top of the file.
|
" Individual tests can overrule this at the top of the file.
|
||||||
|
|
@ -93,7 +95,7 @@ func RunTheTest(test)
|
||||||
" directory after executing the test.
|
" directory after executing the test.
|
||||||
let save_cwd = getcwd()
|
let save_cwd = getcwd()
|
||||||
|
|
||||||
if exists("*SetUp_" . a:test)
|
if exists('*SetUp_' . a:test)
|
||||||
try
|
try
|
||||||
exe 'call SetUp_' . a:test
|
exe 'call SetUp_' . a:test
|
||||||
catch
|
catch
|
||||||
|
|
@ -109,7 +111,7 @@ func RunTheTest(test)
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists("*SetUp")
|
if exists('*SetUp')
|
||||||
try
|
try
|
||||||
call SetUp()
|
call SetUp()
|
||||||
catch
|
catch
|
||||||
|
|
@ -136,9 +138,14 @@ func RunTheTest(test)
|
||||||
let test_filesafe = substitute( a:test, '[)(,:]', '_', 'g' )
|
let test_filesafe = substitute( a:test, '[)(,:]', '_', 'g' )
|
||||||
let s:testid_filesafe = g:testpath . '_' . test_filesafe
|
let s:testid_filesafe = g:testpath . '_' . test_filesafe
|
||||||
|
|
||||||
au VimLeavePre * call EarlyExit(s:test)
|
augroup EarlyExit
|
||||||
|
au!
|
||||||
|
au VimLeavePre * call EarlyExit(s:test)
|
||||||
|
augroup END
|
||||||
|
|
||||||
exe 'call ' . a:test
|
exe 'call ' . a:test
|
||||||
au! VimLeavePre
|
|
||||||
|
au! EarlyExit
|
||||||
catch /^\cskipped/
|
catch /^\cskipped/
|
||||||
call add(s:messages, ' Skipped')
|
call add(s:messages, ' Skipped')
|
||||||
call add(s:skipped,
|
call add(s:skipped,
|
||||||
|
|
@ -164,7 +171,7 @@ func RunTheTest(test)
|
||||||
" reset to avoid trouble with anything else.
|
" reset to avoid trouble with anything else.
|
||||||
set noinsertmode
|
set noinsertmode
|
||||||
|
|
||||||
if exists("*TearDown")
|
if exists('*TearDown')
|
||||||
try
|
try
|
||||||
call TearDown()
|
call TearDown()
|
||||||
catch
|
catch
|
||||||
|
|
@ -179,7 +186,7 @@ func RunTheTest(test)
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists("*TearDown_" . a:test)
|
if exists('*TearDown_' . a:test)
|
||||||
try
|
try
|
||||||
exe 'call TearDown_' . a:test
|
exe 'call TearDown_' . a:test
|
||||||
catch
|
catch
|
||||||
|
|
@ -252,10 +259,9 @@ func FinishTesting()
|
||||||
if filereadable( 'test.log' )
|
if filereadable( 'test.log' )
|
||||||
let l = readfile( 'test.log' )
|
let l = readfile( 'test.log' )
|
||||||
endif
|
endif
|
||||||
call writefile( l->extend( [ '', 'From ' . g:testpath . ':' ] )
|
call extend( l, [ '', 'From ' . g:testpath . ':' ] )
|
||||||
\ ->extend( s:errors ),
|
call extend( l, s:errors )
|
||||||
\ 'test.log',
|
call writefile( l, 'test.log', 's' )
|
||||||
\ 's' )
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if s:done == 0
|
if s:done == 0
|
||||||
|
|
@ -280,10 +286,9 @@ func FinishTesting()
|
||||||
if filereadable( 'messages' )
|
if filereadable( 'messages' )
|
||||||
let l = readfile( 'messages' )
|
let l = readfile( 'messages' )
|
||||||
endif
|
endif
|
||||||
call writefile( l->extend( [ '', 'From ' . g:testpath . ':' ] )
|
call extend( l, [ '', 'From ' . g:testpath . ':' ] )
|
||||||
\ ->extend( s:messages ),
|
call extend( l, s:messages )
|
||||||
\ 'messages',
|
call writefile( l, 'messages', 's' )
|
||||||
\ 's' )
|
|
||||||
|
|
||||||
if s:fail > 0
|
if s:fail > 0
|
||||||
cquit!
|
cquit!
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ function! Test_Step_With_Different_Tabpage()
|
||||||
call assert_equal( 1, col( '.' ), 'Current column' )
|
call assert_equal( 1, col( '.' ), 'Current column' )
|
||||||
|
|
||||||
" Switch to the other tab
|
" Switch to the other tab
|
||||||
normal gt
|
normal! gt
|
||||||
|
|
||||||
call assert_notequal( vimspector_tabnr, tabpagenr() )
|
call assert_notequal( vimspector_tabnr, tabpagenr() )
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue