mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.0.1200: tests switch the bell off twice
Problem: Tests switch the bell off twice. Solution: Don't set 'belloff' in individual tests. (Christian Brabandt)
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
" A series of tests that can run in one Vim invocation.
|
" A series of tests that can run in one Vim invocation.
|
||||||
" This makes testing go faster, since Vim doesn't need to restart.
|
" This makes testing go faster, since Vim doesn't need to restart.
|
||||||
|
|
||||||
set belloff=all
|
|
||||||
source test_assign.vim
|
source test_assign.vim
|
||||||
source test_bufline.vim
|
source test_bufline.vim
|
||||||
source test_cd.vim
|
source test_cd.vim
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
" runtest.vim. Checking for the multi_byte feature is in the individual
|
" runtest.vim. Checking for the multi_byte feature is in the individual
|
||||||
" files, so that they can be run by themselves.
|
" files, so that they can be run by themselves.
|
||||||
|
|
||||||
set belloff=all
|
|
||||||
source test_charsearch_utf8.vim
|
source test_charsearch_utf8.vim
|
||||||
source test_expr_utf8.vim
|
source test_expr_utf8.vim
|
||||||
source test_matchadd_conceal_utf8.vim
|
source test_matchadd_conceal_utf8.vim
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
" Tests for autocommands
|
" Tests for autocommands
|
||||||
|
|
||||||
set belloff=all
|
|
||||||
|
|
||||||
func! s:cleanup_buffers() abort
|
func! s:cleanup_buffers() abort
|
||||||
for bnr in range(1, bufnr('$'))
|
for bnr in range(1, bufnr('$'))
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
" Tests for editing the command line.
|
" Tests for editing the command line.
|
||||||
|
|
||||||
set belloff=all
|
|
||||||
|
|
||||||
func Test_complete_tab()
|
func Test_complete_tab()
|
||||||
call writefile(['testfile'], 'Xtestfile')
|
call writefile(['testfile'], 'Xtestfile')
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
" Tests for diff mode
|
" Tests for diff mode
|
||||||
set belloff=all
|
|
||||||
|
|
||||||
func Test_diff_fold_sync()
|
func Test_diff_fold_sync()
|
||||||
enew!
|
enew!
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
if !has("digraphs") || !has("multi_byte")
|
if !has("digraphs") || !has("multi_byte")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
set belloff=all
|
|
||||||
|
|
||||||
func! Put_Dig(chars)
|
func! Put_Dig(chars)
|
||||||
exe "norm! o\<c-k>".a:chars
|
exe "norm! o\<c-k>".a:chars
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
if exists("+t_kD")
|
if exists("+t_kD")
|
||||||
let &t_kD="[3;*~"
|
let &t_kD="[3;*~"
|
||||||
endif
|
endif
|
||||||
set belloff=
|
|
||||||
|
|
||||||
" Needed for testing basic rightleft: Test_edit_rightleft
|
" Needed for testing basic rightleft: Test_edit_rightleft
|
||||||
source view_util.vim
|
source view_util.vim
|
||||||
@@ -26,7 +25,6 @@ func! Test_edit_01()
|
|||||||
" set for Travis CI?
|
" set for Travis CI?
|
||||||
" set nocp noesckeys
|
" set nocp noesckeys
|
||||||
new
|
new
|
||||||
set belloff=backspace
|
|
||||||
" 1) empty buffer
|
" 1) empty buffer
|
||||||
call assert_equal([''], getline(1,'$'))
|
call assert_equal([''], getline(1,'$'))
|
||||||
" 2) delete in an empty line
|
" 2) delete in an empty line
|
||||||
@@ -59,7 +57,6 @@ func! Test_edit_01()
|
|||||||
call cursor(1, 1)
|
call cursor(1, 1)
|
||||||
call feedkeys("A\<del>\<esc>", 'tnix')
|
call feedkeys("A\<del>\<esc>", 'tnix')
|
||||||
call assert_equal(["abc def", "ghi jkl"], getline(1, 2))
|
call assert_equal(["abc def", "ghi jkl"], getline(1, 2))
|
||||||
set belloff=
|
|
||||||
let &bs=_bs
|
let &bs=_bs
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
@@ -475,13 +472,11 @@ func! Test_edit_00a_CTRL_A()
|
|||||||
new
|
new
|
||||||
call setline(1, repeat([''], 5))
|
call setline(1, repeat([''], 5))
|
||||||
call cursor(1, 1)
|
call cursor(1, 1)
|
||||||
set belloff=all
|
|
||||||
try
|
try
|
||||||
call feedkeys("A\<NUL>", 'tnix')
|
call feedkeys("A\<NUL>", 'tnix')
|
||||||
catch /^Vim\%((\a\+)\)\=:E29/
|
catch /^Vim\%((\a\+)\)\=:E29/
|
||||||
call assert_true(1, 'E29 error caught')
|
call assert_true(1, 'E29 error caught')
|
||||||
endtry
|
endtry
|
||||||
set belloff=
|
|
||||||
call cursor(1, 1)
|
call cursor(1, 1)
|
||||||
call feedkeys("Afoobar \<esc>", 'tnix')
|
call feedkeys("Afoobar \<esc>", 'tnix')
|
||||||
call cursor(2, 1)
|
call cursor(2, 1)
|
||||||
@@ -510,7 +505,6 @@ endfunc
|
|||||||
|
|
||||||
func! Test_edit_CTRL_G()
|
func! Test_edit_CTRL_G()
|
||||||
new
|
new
|
||||||
set belloff=all
|
|
||||||
call setline(1, ['foobar', 'foobar', 'foobar'])
|
call setline(1, ['foobar', 'foobar', 'foobar'])
|
||||||
call cursor(2, 4)
|
call cursor(2, 4)
|
||||||
call feedkeys("ioooooooo\<c-g>k\<c-r>.\<esc>", 'tnix')
|
call feedkeys("ioooooooo\<c-g>k\<c-r>.\<esc>", 'tnix')
|
||||||
@@ -524,7 +518,6 @@ func! Test_edit_CTRL_G()
|
|||||||
call assert_equal([0, 3, 7, 0], getpos('.'))
|
call assert_equal([0, 3, 7, 0], getpos('.'))
|
||||||
call feedkeys("i\<c-g>j\<esc>", 'tnix')
|
call feedkeys("i\<c-g>j\<esc>", 'tnix')
|
||||||
call assert_equal([0, 3, 6, 0], getpos('.'))
|
call assert_equal([0, 3, 6, 0], getpos('.'))
|
||||||
set belloff=
|
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -604,7 +597,6 @@ func! Test_edit_CTRL_K()
|
|||||||
%d
|
%d
|
||||||
call setline(1, 'A')
|
call setline(1, 'A')
|
||||||
call cursor(1, 1)
|
call cursor(1, 1)
|
||||||
set belloff=all
|
|
||||||
let v:testing = 1
|
let v:testing = 1
|
||||||
try
|
try
|
||||||
call feedkeys("A\<c-x>\<c-k>\<esc>", 'tnix')
|
call feedkeys("A\<c-x>\<c-k>\<esc>", 'tnix')
|
||||||
@@ -612,7 +604,6 @@ func! Test_edit_CTRL_K()
|
|||||||
" error sleeps 2 seconds, when v:testing is not set
|
" error sleeps 2 seconds, when v:testing is not set
|
||||||
let v:testing = 0
|
let v:testing = 0
|
||||||
endtry
|
endtry
|
||||||
set belloff=
|
|
||||||
call delete('Xdictionary.txt')
|
call delete('Xdictionary.txt')
|
||||||
|
|
||||||
if has("multi_byte")
|
if has("multi_byte")
|
||||||
@@ -853,7 +844,6 @@ func! Test_edit_CTRL_T()
|
|||||||
%d
|
%d
|
||||||
call setline(1, 'mad')
|
call setline(1, 'mad')
|
||||||
call cursor(1, 1)
|
call cursor(1, 1)
|
||||||
set belloff=all
|
|
||||||
let v:testing = 1
|
let v:testing = 1
|
||||||
try
|
try
|
||||||
call feedkeys("A\<c-x>\<c-t>\<esc>", 'tnix')
|
call feedkeys("A\<c-x>\<c-t>\<esc>", 'tnix')
|
||||||
@@ -861,7 +851,6 @@ func! Test_edit_CTRL_T()
|
|||||||
" error sleeps 2 seconds, when v:testing is not set
|
" error sleeps 2 seconds, when v:testing is not set
|
||||||
let v:testing = 0
|
let v:testing = 0
|
||||||
endtry
|
endtry
|
||||||
set belloff=
|
|
||||||
call assert_equal(['mad'], getline(1, '$'))
|
call assert_equal(['mad'], getline(1, '$'))
|
||||||
call delete('Xthesaurus')
|
call delete('Xthesaurus')
|
||||||
bw!
|
bw!
|
||||||
@@ -1033,7 +1022,6 @@ endfunc
|
|||||||
func! Test_edit_LEFT_RIGHT()
|
func! Test_edit_LEFT_RIGHT()
|
||||||
" Left, Shift-Left, Right, Shift-Right
|
" Left, Shift-Left, Right, Shift-Right
|
||||||
new
|
new
|
||||||
set belloff=all
|
|
||||||
call setline(1, ['abc def ghi', 'ABC DEF GHI', 'ZZZ YYY XXX'])
|
call setline(1, ['abc def ghi', 'ABC DEF GHI', 'ZZZ YYY XXX'])
|
||||||
let _ww=&ww
|
let _ww=&ww
|
||||||
set ww=
|
set ww=
|
||||||
@@ -1075,7 +1063,6 @@ func! Test_edit_LEFT_RIGHT()
|
|||||||
call feedkeys("A\<s-right>\<esc>", 'tnix')
|
call feedkeys("A\<s-right>\<esc>", 'tnix')
|
||||||
call assert_equal([0, 3, 1, 0], getpos('.'))
|
call assert_equal([0, 3, 1, 0], getpos('.'))
|
||||||
let &ww = _ww
|
let &ww = _ww
|
||||||
set belloff=
|
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -1135,7 +1122,6 @@ func! Test_edit_MOUSE()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func! Test_edit_PAGEUP_PAGEDOWN()
|
func! Test_edit_PAGEUP_PAGEDOWN()
|
||||||
set belloff=all
|
|
||||||
10new
|
10new
|
||||||
call setline(1, repeat(['abc def ghi'], 30))
|
call setline(1, repeat(['abc def ghi'], 30))
|
||||||
call cursor(1, 1)
|
call cursor(1, 1)
|
||||||
@@ -1231,12 +1217,10 @@ func! Test_edit_PAGEUP_PAGEDOWN()
|
|||||||
call assert_equal([0, 30, 11, 0], getpos('.'))
|
call assert_equal([0, 30, 11, 0], getpos('.'))
|
||||||
call feedkeys("A\<S-Down>\<esc>", 'tnix')
|
call feedkeys("A\<S-Down>\<esc>", 'tnix')
|
||||||
call assert_equal([0, 30, 11, 0], getpos('.'))
|
call assert_equal([0, 30, 11, 0], getpos('.'))
|
||||||
set startofline belloff=
|
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func! Test_edit_forbidden()
|
func! Test_edit_forbidden()
|
||||||
set belloff=error,esc
|
|
||||||
new
|
new
|
||||||
" 1) edit in the sandbox is not allowed
|
" 1) edit in the sandbox is not allowed
|
||||||
call setline(1, 'a')
|
call setline(1, 'a')
|
||||||
@@ -1293,7 +1277,6 @@ func! Test_edit_forbidden()
|
|||||||
set norevins nofkmap
|
set norevins nofkmap
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
set belloff=
|
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ func Test_File_Size()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
new
|
new
|
||||||
set belloff=all fileformat=unix undolevels=-1
|
set fileformat=unix undolevels=-1
|
||||||
for i in range(1, 2000000, 100)
|
for i in range(1, 2000000, 100)
|
||||||
call append(i, range(i, i + 99))
|
call append(i, range(i, i + 99))
|
||||||
endfor
|
endfor
|
||||||
@@ -26,7 +26,7 @@ func Test_File_Size()
|
|||||||
|
|
||||||
enew!
|
enew!
|
||||||
call delete('Xtest')
|
call delete('Xtest')
|
||||||
set belloff& fileformat& undolevels&
|
set fileformat& undolevels&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for writing and reading a file of over 100 Kbyte
|
" Test for writing and reading a file of over 100 Kbyte
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
" Test for gn command
|
" Test for gn command
|
||||||
|
|
||||||
func Test_gn_command()
|
func Test_gn_command()
|
||||||
set belloff=all
|
|
||||||
noautocmd new
|
noautocmd new
|
||||||
" replace a single char by itsself quoted:
|
" replace a single char by itsself quoted:
|
||||||
call setline('.', 'abc x def x ghi x jkl')
|
call setline('.', 'abc x def x ghi x jkl')
|
||||||
@@ -121,7 +120,6 @@ func Test_gn_command()
|
|||||||
sil! %d_
|
sil! %d_
|
||||||
|
|
||||||
set wrapscan&vim
|
set wrapscan&vim
|
||||||
set belloff&vim
|
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
" Test for various Normal mode commands
|
" Test for various Normal mode commands
|
||||||
|
|
||||||
set belloff=all
|
|
||||||
func! Setup_NewWindow()
|
func! Setup_NewWindow()
|
||||||
10new
|
10new
|
||||||
call setline(1, range(1,100))
|
call setline(1, range(1,100))
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
" Tests for 'packpath' and :packadd
|
" Tests for 'packpath' and :packadd
|
||||||
|
|
||||||
set belloff=all
|
|
||||||
|
|
||||||
func SetUp()
|
func SetUp()
|
||||||
let s:topdir = expand('%:h') . '/Xdir'
|
let s:topdir = expand('%:h') . '/Xdir'
|
||||||
|
@@ -38,7 +38,6 @@ endfu
|
|||||||
func! Test_popup_complete()
|
func! Test_popup_complete()
|
||||||
new
|
new
|
||||||
inoremap <f5> <c-r>=ListMonths()<cr>
|
inoremap <f5> <c-r>=ListMonths()<cr>
|
||||||
set belloff=all
|
|
||||||
|
|
||||||
" <C-E> - select original typed text before the completion started
|
" <C-E> - select original typed text before the completion started
|
||||||
call feedkeys("aJu\<f5>\<down>\<c-e>\<esc>", 'tx')
|
call feedkeys("aJu\<f5>\<down>\<c-e>\<esc>", 'tx')
|
||||||
@@ -215,7 +214,6 @@ func! Test_popup_complete()
|
|||||||
call feedkeys("aM\<f5>\<enter>\<esc>", 'tx')
|
call feedkeys("aM\<f5>\<enter>\<esc>", 'tx')
|
||||||
call assert_equal(["March", "M", "March"], getline(1,4))
|
call assert_equal(["March", "M", "March"], getline(1,4))
|
||||||
%d
|
%d
|
||||||
set belloff&
|
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
|
|
||||||
@@ -517,7 +515,6 @@ endfunc
|
|||||||
|
|
||||||
func Test_completion_respect_bs_option()
|
func Test_completion_respect_bs_option()
|
||||||
new
|
new
|
||||||
set belloff=all
|
|
||||||
let li = ["aaa", "aaa12345", "aaaabcdef", "aaaABC"]
|
let li = ["aaa", "aaa12345", "aaaabcdef", "aaaABC"]
|
||||||
|
|
||||||
set bs=indent,eol
|
set bs=indent,eol
|
||||||
@@ -533,7 +530,6 @@ func Test_completion_respect_bs_option()
|
|||||||
call feedkeys("A\<C-X>\<C-N>\<C-P>\<BS>\<BS>\<BS>\<Esc>", "tx")
|
call feedkeys("A\<C-X>\<C-N>\<C-P>\<BS>\<BS>\<BS>\<Esc>", "tx")
|
||||||
call assert_equal('', getline(1))
|
call assert_equal('', getline(1))
|
||||||
|
|
||||||
set belloff&
|
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -620,7 +616,6 @@ endfunc
|
|||||||
|
|
||||||
func Test_complete_CTRLN_startofbuffer()
|
func Test_complete_CTRLN_startofbuffer()
|
||||||
new
|
new
|
||||||
set belloff=all
|
|
||||||
call setline(1, [ 'organize(cupboard, 3, 2);',
|
call setline(1, [ 'organize(cupboard, 3, 2);',
|
||||||
\ 'prioritize(bureau, 8, 7);',
|
\ 'prioritize(bureau, 8, 7);',
|
||||||
\ 'realize(bannister, 4, 4);',
|
\ 'realize(bannister, 4, 4);',
|
||||||
@@ -631,7 +626,6 @@ func Test_complete_CTRLN_startofbuffer()
|
|||||||
\ 'railing.moralize(3,9);']
|
\ 'railing.moralize(3,9);']
|
||||||
call feedkeys("qai\<c-n>\<c-n>.\<esc>3wdW\<cr>q3@a", 'tx')
|
call feedkeys("qai\<c-n>\<c-n>.\<esc>3wdW\<cr>q3@a", 'tx')
|
||||||
call assert_equal(expected, getline(1,'$'))
|
call assert_equal(expected, getline(1,'$'))
|
||||||
set belloff&
|
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ endfunc
|
|||||||
" We need about 10000 lines of 100 characters to get two levels of pointer
|
" We need about 10000 lines of 100 characters to get two levels of pointer
|
||||||
" blocks.
|
" blocks.
|
||||||
func Test_swap_file()
|
func Test_swap_file()
|
||||||
set fileformat=unix undolevels=-1 belloff=all
|
set fileformat=unix undolevels=-1
|
||||||
edit! Xtest
|
edit! Xtest
|
||||||
let text = "\tabcdefghijklmnoparstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnoparstuvwxyz0123456789"
|
let text = "\tabcdefghijklmnoparstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnoparstuvwxyz0123456789"
|
||||||
let i = 1
|
let i = 1
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
" Test for the search command
|
" Test for the search command
|
||||||
|
|
||||||
set belloff=all
|
|
||||||
func Test_search_cmdline()
|
func Test_search_cmdline()
|
||||||
if !exists('+incsearch')
|
if !exists('+incsearch')
|
||||||
return
|
return
|
||||||
|
@@ -4,7 +4,6 @@ if !has('textobjects')
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
set belloff=all
|
|
||||||
func CpoM(line, useM, expected)
|
func CpoM(line, useM, expected)
|
||||||
new
|
new
|
||||||
|
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
" undo-able pieces. Do that by setting 'undolevels'.
|
" undo-able pieces. Do that by setting 'undolevels'.
|
||||||
" Also tests :earlier and :later.
|
" Also tests :earlier and :later.
|
||||||
|
|
||||||
set belloff=all
|
|
||||||
func Test_undotree()
|
func Test_undotree()
|
||||||
exe "normal Aabc\<Esc>"
|
exe "normal Aabc\<Esc>"
|
||||||
set ul=100
|
set ul=100
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
" Tests for user defined commands
|
" Tests for user defined commands
|
||||||
|
|
||||||
" Test for <mods> in user defined commands
|
" Test for <mods> in user defined commands
|
||||||
set belloff=all
|
|
||||||
function Test_cmdmods()
|
function Test_cmdmods()
|
||||||
let g:mods = ''
|
let g:mods = ''
|
||||||
|
|
||||||
|
@@ -3,7 +3,6 @@ if !has('visual')
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
set belloff=all
|
|
||||||
|
|
||||||
func Test_block_shift_multibyte()
|
func Test_block_shift_multibyte()
|
||||||
" Uses double-wide character.
|
" Uses double-wide character.
|
||||||
@@ -76,7 +75,6 @@ func TriggerTheProblem()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_visual_mode_reset()
|
func Test_visual_mode_reset()
|
||||||
set belloff=all
|
|
||||||
enew
|
enew
|
||||||
let g:msg="Everything's fine."
|
let g:msg="Everything's fine."
|
||||||
enew
|
enew
|
||||||
@@ -89,5 +87,5 @@ func Test_visual_mode_reset()
|
|||||||
exe "normal! GV:call TriggerTheProblem()\<CR>"
|
exe "normal! GV:call TriggerTheProblem()\<CR>"
|
||||||
call assert_equal("Everything's fine.", g:msg)
|
call assert_equal("Everything's fine.", g:msg)
|
||||||
|
|
||||||
set belloff&
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -761,6 +761,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1200,
|
||||||
/**/
|
/**/
|
||||||
1199,
|
1199,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user