forked from aniani/vim
patch 8.0.0440: not enough test coverage in Insert mode
Problem: Not enough test coverage in Insert mode.
Solution: Add lots of tests. Add test_override(). (Christian Brabandt,
closes #1521)
This commit is contained in:
@@ -151,6 +151,7 @@ NEW_TESTS = test_arabic.res \
|
||||
test_diffmode.res \
|
||||
test_digraph.res \
|
||||
test_display.res \
|
||||
test_edit.res \
|
||||
test_farsi.res \
|
||||
test_fnameescape.res \
|
||||
test_fold.res \
|
||||
|
||||
@@ -49,7 +49,7 @@ source setup.vim
|
||||
" This also enables use of line continuation.
|
||||
set nocp viminfo+=nviminfo
|
||||
|
||||
" Use utf-8 or latin1 be default, instead of whatever the system default
|
||||
" Use utf-8 or latin1 by default, instead of whatever the system default
|
||||
" happens to be. Individual tests can overrule this at the top of the file.
|
||||
if has('multi_byte')
|
||||
set encoding=utf-8
|
||||
@@ -96,6 +96,9 @@ function RunTheTest(test)
|
||||
" mode message.
|
||||
set noshowmode
|
||||
|
||||
" Clear any overrides.
|
||||
call test_override('ALL', 0)
|
||||
|
||||
if exists("*SetUp")
|
||||
try
|
||||
call SetUp()
|
||||
|
||||
@@ -127,6 +127,14 @@ func Test_assert_with_msg()
|
||||
call remove(v:errors, 0)
|
||||
endfunc
|
||||
|
||||
func Test_override()
|
||||
call test_override('char_avail', 1)
|
||||
call test_override('redraw', 1)
|
||||
call test_override('ALL', 0)
|
||||
call assert_fails("call test_override('xxx', 1)", 'E475')
|
||||
call assert_fails("call test_override('redraw', 'yes')", 'E474')
|
||||
endfunc
|
||||
|
||||
func Test_user_is_happy()
|
||||
smile
|
||||
sleep 300m
|
||||
|
||||
@@ -44,9 +44,9 @@ func Test_curswant_with_autocommand()
|
||||
new
|
||||
call setline(1, ['func()', '{', '}', '----'])
|
||||
autocmd! CursorMovedI * call s:Highlight_Matching_Pair()
|
||||
call test_disable_char_avail(1)
|
||||
call test_override("char_avail", 1)
|
||||
exe "normal! 3Ga\<Down>X\<Esc>"
|
||||
call test_disable_char_avail(0)
|
||||
call test_override("char_avail", 0)
|
||||
call assert_equal('-X---', getline(4))
|
||||
autocmd! CursorMovedI *
|
||||
quit!
|
||||
|
||||
1324
src/testdir/test_edit.vim
Normal file
1324
src/testdir/test_edit.vim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@ func Test_search_cmdline()
|
||||
endif
|
||||
" need to disable char_avail,
|
||||
" so that expansion of commandline works
|
||||
call test_disable_char_avail(1)
|
||||
call test_override("char_avail", 1)
|
||||
new
|
||||
call setline(1, [' 1', ' 2 these', ' 3 the', ' 4 their', ' 5 there', ' 6 their', ' 7 the', ' 8 them', ' 9 these', ' 10 foobar'])
|
||||
" Test 1
|
||||
@@ -194,7 +194,7 @@ func Test_search_cmdline()
|
||||
call assert_equal(' 3 the', getline('.'))
|
||||
|
||||
" clean up
|
||||
call test_disable_char_avail(0)
|
||||
call test_override("char_avail", 0)
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
@@ -204,7 +204,7 @@ func Test_search_cmdline2()
|
||||
endif
|
||||
" need to disable char_avail,
|
||||
" so that expansion of commandline works
|
||||
call test_disable_char_avail(1)
|
||||
call test_override("char_avail", 1)
|
||||
new
|
||||
call setline(1, [' 1', ' 2 these', ' 3 the theother'])
|
||||
" Test 1
|
||||
@@ -266,7 +266,7 @@ func Test_search_cmdline2()
|
||||
|
||||
" clean up
|
||||
set noincsearch
|
||||
call test_disable_char_avail(0)
|
||||
call test_override("char_avail", 0)
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user