0
0
mirror of https://github.com/vim/vim.git synced 2025-07-25 10:54:51 -04:00

patch 8.2.0687: some tests do not work on FreeBSD

Problem:    Some tests do not work on FreeBSD.
Solution:   Enable modeline.  Use WaitFor() in more cases. (Ozaki Kiichi,
            closes #6036)
This commit is contained in:
Bram Moolenaar 2020-05-03 16:29:50 +02:00
parent 2eaeaf3c31
commit 41d4299f26
3 changed files with 13 additions and 9 deletions

View File

@ -1708,7 +1708,6 @@ func s:create_test_file(filename)
endfunc endfunc
func Test_switchbuf() func Test_switchbuf()
CheckNotBSD
call s:create_test_file('Xqftestfile1') call s:create_test_file('Xqftestfile1')
call s:create_test_file('Xqftestfile2') call s:create_test_file('Xqftestfile2')
call s:create_test_file('Xqftestfile3') call s:create_test_file('Xqftestfile3')
@ -1834,6 +1833,7 @@ func Test_switchbuf()
" If opening a file changes 'switchbuf', then the new value should be " If opening a file changes 'switchbuf', then the new value should be
" retained. " retained.
set modeline&vim
call writefile(["vim: switchbuf=split"], 'Xqftestfile1') call writefile(["vim: switchbuf=split"], 'Xqftestfile1')
enew | only enew | only
set switchbuf&vim set switchbuf&vim

View File

@ -894,7 +894,6 @@ func Test_terminal_wqall()
endfunc endfunc
func Test_terminal_composing_unicode() func Test_terminal_composing_unicode()
CheckNotBSD
let save_enc = &encoding let save_enc = &encoding
set encoding=utf-8 set encoding=utf-8
@ -909,7 +908,7 @@ func Test_terminal_composing_unicode()
enew enew
let buf = term_start(cmd, {'curwin': bufnr('')}) let buf = term_start(cmd, {'curwin': bufnr('')})
let g:job = term_getjob(buf) let g:job = term_getjob(buf)
call TermWait(buf, 25) call WaitFor({-> term_getline(buf, 1) !=# ''}, 1000)
if has('win32') if has('win32')
call assert_equal('cmd', job_info(g:job).cmd[0]) call assert_equal('cmd', job_info(g:job).cmd[0])
@ -919,10 +918,11 @@ func Test_terminal_composing_unicode()
" ascii + composing " ascii + composing
let txt = "a\u0308bc" let txt = "a\u0308bc"
call term_sendkeys(buf, "echo " . txt . "\r") call term_sendkeys(buf, "echo " . txt)
call TermWait(buf, 25) call TermWait(buf, 25)
call assert_match("echo " . txt, term_getline(buf, lnum[0])) call assert_match("echo " . txt, term_getline(buf, lnum[0]))
call assert_equal(txt, term_getline(buf, lnum[0] + 1)) call term_sendkeys(buf, "\<cr>")
call WaitForAssert({-> assert_equal(txt, term_getline(buf, lnum[0] + 1))}, 1000)
let l = term_scrape(buf, lnum[0] + 1) let l = term_scrape(buf, lnum[0] + 1)
call assert_equal("a\u0308", l[0].chars) call assert_equal("a\u0308", l[0].chars)
call assert_equal("b", l[1].chars) call assert_equal("b", l[1].chars)
@ -930,10 +930,11 @@ func Test_terminal_composing_unicode()
" multibyte + composing " multibyte + composing
let txt = "\u304b\u3099\u304e\u304f\u3099\u3052\u3053\u3099" let txt = "\u304b\u3099\u304e\u304f\u3099\u3052\u3053\u3099"
call term_sendkeys(buf, "echo " . txt . "\r") call term_sendkeys(buf, "echo " . txt)
call TermWait(buf, 25) call TermWait(buf, 25)
call assert_match("echo " . txt, term_getline(buf, lnum[1])) call assert_match("echo " . txt, term_getline(buf, lnum[1]))
call assert_equal(txt, term_getline(buf, lnum[1] + 1)) call term_sendkeys(buf, "\<cr>")
call WaitForAssert({-> assert_equal(txt, term_getline(buf, lnum[1] + 1))}, 1000)
let l = term_scrape(buf, lnum[1] + 1) let l = term_scrape(buf, lnum[1] + 1)
call assert_equal("\u304b\u3099", l[0].chars) call assert_equal("\u304b\u3099", l[0].chars)
call assert_equal("\u304e", l[1].chars) call assert_equal("\u304e", l[1].chars)
@ -943,10 +944,11 @@ func Test_terminal_composing_unicode()
" \u00a0 + composing " \u00a0 + composing
let txt = "abc\u00a0\u0308" let txt = "abc\u00a0\u0308"
call term_sendkeys(buf, "echo " . txt . "\r") call term_sendkeys(buf, "echo " . txt)
call TermWait(buf, 25) call TermWait(buf, 25)
call assert_match("echo " . txt, term_getline(buf, lnum[2])) call assert_match("echo " . txt, term_getline(buf, lnum[2]))
call assert_equal(txt, term_getline(buf, lnum[2] + 1)) call term_sendkeys(buf, "\<cr>")
call WaitForAssert({-> assert_equal(txt, term_getline(buf, lnum[2] + 1))}, 1000)
let l = term_scrape(buf, lnum[2] + 1) let l = term_scrape(buf, lnum[2] + 1)
call assert_equal("\u00a0\u0308", l[3].chars) call assert_equal("\u00a0\u0308", l[3].chars)

View File

@ -746,6 +746,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 */
/**/
687,
/**/ /**/
686, 686,
/**/ /**/