0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 9.1.1174: tests: Test_complete_cmdline() may fail

Problem:  tests: when the file 'TestCommand?Test' exists,
          'Test_complete_cmdline()' will fail when writing the file. And
          there's no related cleaning operation for this kind of file
          before the test run.
Solution: modify `write` to `write!` to override (Jim Zhou).

closes: #16799

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Jim Zhou 2025-03-05 20:25:11 +01:00 committed by Christian Brabandt
parent 4783a2c073
commit f7087cbec7
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 4 additions and 2 deletions

View File

@ -1179,8 +1179,8 @@ func Test_complete_cmdline()
call assert_equal('abcxyz(', getline(3)) call assert_equal('abcxyz(', getline(3))
com! -buffer TestCommand1 echo 'TestCommand1' com! -buffer TestCommand1 echo 'TestCommand1'
com! -buffer TestCommand2 echo 'TestCommand2' com! -buffer TestCommand2 echo 'TestCommand2'
write TestCommand1Test write! TestCommand1Test
write TestCommand2Test write! TestCommand2Test
" Test repeating <CTRL-X> <CTRL-V> and switching to another CTRL-X mode " Test repeating <CTRL-X> <CTRL-V> and switching to another CTRL-X mode
exe "normal oT\<C-X>\<C-V>\<C-X>\<C-V>\<C-X>\<C-F>\<Esc>" exe "normal oT\<C-X>\<C-V>\<C-X>\<C-V>\<C-X>\<C-F>\<Esc>"
call assert_equal('TestCommand2Test', getline(4)) call assert_equal('TestCommand2Test', getline(4))

View File

@ -704,6 +704,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 */
/**/
1174,
/**/ /**/
1173, 1173,
/**/ /**/