From a118134af1ef08884dfceb9e9cd9bf2ba662b7d8 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 29 Jul 2017 16:36:54 +0200 Subject: test/legacy: avoid TSAN CI build hang This delete() sometimes hangs the TSAN build. Work around it by using a unique filename. Do it at the start instead of the end, for hygiene (though it doesn't actually matter on CI, it helps local dev). --- src/nvim/testdir/test_normal.vim | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'src/nvim/testdir/test_normal.vim') diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index 6261625801..4747d5704d 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -1255,21 +1255,27 @@ func! Test_normal22_zet() " Test for ZZ " let shell = &shell " let &shell = 'sh' - call writefile(['1', '2'], 'Xfile') + + " Remove any stale test files from previous run. + for file in ['Xfile_Test_normal22_zet'] + call delete(file) + endfor + + call writefile(['1', '2'], 'Xfile_Test_normal22_zet') let args = ' --headless -u NONE -N -U NONE -i NONE --noplugins' - call system(v:progpath . args . ' -c "%d" -c ":norm! ZZ" Xfile') - let a = readfile('Xfile') + call system(v:progpath . args . ' -c "%d" -c ":norm! ZZ" Xfile_Test_normal22_zet') + let a = readfile('Xfile_Test_normal22_zet') call assert_equal([], a) " Test for ZQ - call writefile(['1', '2'], 'Xfile') - call system(v:progpath . args . ' -c "%d" -c ":norm! ZQ" Xfile') - let a = readfile('Xfile') + call writefile(['1', '2'], 'Xfile_Test_normal22_zet') + call system(v:progpath . args . ' -c "%d" -c ":norm! ZQ" Xfile_Test_normal22_zet') + let a = readfile('Xfile_Test_normal22_zet') call assert_equal(['1', '2'], a) - " clean up - for file in ['Xfile'] - call delete(file) - endfor + " Nvim: This sometimes hangs the TSAN build. + " for file in ['Xfile_Test_normal22_zet'] + " call delete(file) + " endfor " let &shell = shell endfunc -- cgit From 2b1bcd446b6d95f608161818addecf7c6a2beeaa Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 13 Jan 2018 19:59:05 +0100 Subject: runtime: include en.utf-8.spl Install en.utf-8.spl by default. - Allows spell-related tests to run. - Avoids download prompt for spelllang=en users --- src/nvim/testdir/test_normal.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_normal.vim') diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index 4747d5704d..8635daa7ad 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -1,5 +1,7 @@ " Test for various Normal mode commands +source shared.vim + func! Setup_NewWindow() 10new call setline(1, range(1,100)) @@ -1069,10 +1071,10 @@ func! Test_normal18_z_fold() endfunc func! Test_normal19_z_spell() - throw "skipped: Nvim 'spell' requires download" if !has("spell") || !has('syntax') return endif + " let $TMPDIR=fnamemodify($TMPDIR, ':.') new call append(0, ['1 good', '2 goood', '3 goood']) set spell spellfile=./Xspellfile.add spelllang=en @@ -1119,7 +1121,9 @@ func! Test_normal19_z_spell() " Test for zG let a=execute('unsilent norm! V$zG') call assert_match("Word '2 goood' added to .*", a) + set shortmess= let fname=matchstr(a, 'to\s\+\zs\f\+$') + let fname=Fix_truncated_tmpfile(fname) let cnt=readfile(fname) call assert_equal('2 goood', cnt[0]) -- cgit From ce09d4134b05cfdf6f71bcc93bb5cb9e48e4d9a0 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 21 Jan 2018 10:26:40 +0100 Subject: vim-patch:8.0.0433: beeps when running tests Problem: Quite a few beeps when running tests. Solution: Set 'belloff' for these tests. (Christian Brabandt) https://github.com/vim/vim/commit/c3c766ea8c35f5b2bd45fb3d74d0ae46b2d8c24f --- src/nvim/testdir/test_normal.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/testdir/test_normal.vim') diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index 8635daa7ad..c28d76e66f 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -2,6 +2,7 @@ source shared.vim +set belloff=all func! Setup_NewWindow() 10new call setline(1, range(1,100)) -- cgit From 090cd109758193de04865d6d8968ece524ae689a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 23 Jan 2018 23:02:43 +0100 Subject: test/old: Fix_truncated_tmpfile(): more flexible --- src/nvim/testdir/test_normal.vim | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/nvim/testdir/test_normal.vim') diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index c28d76e66f..307f62e17a 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -1075,7 +1075,6 @@ func! Test_normal19_z_spell() if !has("spell") || !has('syntax') return endif - " let $TMPDIR=fnamemodify($TMPDIR, ':.') new call append(0, ['1 good', '2 goood', '3 goood']) set spell spellfile=./Xspellfile.add spelllang=en @@ -1122,7 +1121,6 @@ func! Test_normal19_z_spell() " Test for zG let a=execute('unsilent norm! V$zG') call assert_match("Word '2 goood' added to .*", a) - set shortmess= let fname=matchstr(a, 'to\s\+\zs\f\+$') let fname=Fix_truncated_tmpfile(fname) let cnt=readfile(fname) -- cgit From 163b2b241b174f64e73eeacaaa733fd6ab037262 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 11 Feb 2018 15:44:26 +0100 Subject: vim-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) https://github.com/vim/vim/commit/67418d97b457d2e27fe342472d3c9fd342ffc47f --- src/nvim/testdir/test_normal.vim | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/testdir/test_normal.vim') diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index 307f62e17a..c7c0dc164c 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -2,7 +2,6 @@ source shared.vim -set belloff=all func! Setup_NewWindow() 10new call setline(1, range(1,100)) -- cgit From c68d89521fc92834086abb6ad5ed12327b62ff60 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 12 Feb 2018 00:05:54 +0100 Subject: vim-patch:8.0.1271: still too many old style tests Problem: Still too many old style tests. Solution: Convert a few more tests to new style. (Yegappan Lakshmanan, closes vim/vim#2290) https://github.com/vim/vim/commit/fb094e14c19337de824d4e6710ca6a2617930ab0 --- src/nvim/testdir/test_normal.vim | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src/nvim/testdir/test_normal.vim') diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index c7c0dc164c..1d15c7f83d 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -2337,3 +2337,45 @@ func! Test_normal54_Ctrl_bsl() " clean up bw! endfunc + +" Test for the gr (virtual replace) command +" Test for the bug fixed by 7.4.387 +func Test_gr_command() + enew! + let save_cpo = &cpo + call append(0, ['First line', 'Second line', 'Third line']) + exe "normal i\u" + call cursor(2, 1) + set cpo-=X + normal 4gro + call assert_equal('oooond line', getline(2)) + undo + set cpo+=X + normal 4gro + call assert_equal('ooooecond line', getline(2)) + let &cpo = save_cpo + enew! +endfunc + +" When splitting a window the changelist position is wrong. +" Test the changelist position after splitting a window. +" Test for the bug fixed by 7.4.386 +func Test_changelist() + let save_ul = &ul + enew! + call append('$', ['1', '2']) + exe "normal i\u" + exe "normal Gkylpa\u" + set ul=100 + exe "normal Gylpa\u" + set ul=100 + normal gg + vsplit + normal g; + call assert_equal([3, 2], [line('.'), col('.')]) + normal g; + call assert_equal([2, 2], [line('.'), col('.')]) + call assert_fails('normal g;', 'E662:') + %bwipe! + let &ul = save_ul +endfunc -- cgit