summaryrefslogtreecommitdiff
path: root/src/testdir/test_terminal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-03 16:29:50 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-03 16:29:50 +0200
commit41d4299f26cc98e253f9c63f8adc9dbb9d49ed5c (patch)
tree43559b79bba8f2d2b153b3b4376377c9865e477f /src/testdir/test_terminal.vim
parent2eaeaf3c317a5145fb0bc926411561d50883019b (diff)
downloadvim-git-41d4299f26cc98e253f9c63f8adc9dbb9d49ed5c.tar.gz
patch 8.2.0687: some tests do not work on FreeBSDv8.2.0687
Problem: Some tests do not work on FreeBSD. Solution: Enable modeline. Use WaitFor() in more cases. (Ozaki Kiichi, closes #6036)
Diffstat (limited to 'src/testdir/test_terminal.vim')
-rw-r--r--src/testdir/test_terminal.vim18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index 49bce7375..f7b12e376 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -894,7 +894,6 @@ func Test_terminal_wqall()
endfunc
func Test_terminal_composing_unicode()
- CheckNotBSD
let save_enc = &encoding
set encoding=utf-8
@@ -909,7 +908,7 @@ func Test_terminal_composing_unicode()
enew
let buf = term_start(cmd, {'curwin': bufnr('')})
let g:job = term_getjob(buf)
- call TermWait(buf, 25)
+ call WaitFor({-> term_getline(buf, 1) !=# ''}, 1000)
if has('win32')
call assert_equal('cmd', job_info(g:job).cmd[0])
@@ -919,10 +918,11 @@ func Test_terminal_composing_unicode()
" ascii + composing
let txt = "a\u0308bc"
- call term_sendkeys(buf, "echo " . txt . "\r")
+ call term_sendkeys(buf, "echo " . txt)
call TermWait(buf, 25)
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)
call assert_equal("a\u0308", l[0].chars)
call assert_equal("b", l[1].chars)
@@ -930,10 +930,11 @@ func Test_terminal_composing_unicode()
" multibyte + composing
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 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)
call assert_equal("\u304b\u3099", l[0].chars)
call assert_equal("\u304e", l[1].chars)
@@ -943,10 +944,11 @@ func Test_terminal_composing_unicode()
" \u00a0 + composing
let txt = "abc\u00a0\u0308"
- call term_sendkeys(buf, "echo " . txt . "\r")
+ call term_sendkeys(buf, "echo " . txt)
call TermWait(buf, 25)
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)
call assert_equal("\u00a0\u0308", l[3].chars)