vim-patch:8.1.0387: no test for 'ambiwidth' detection

Problem:    No test for 'ambiwidth' detection.
Solution:   Add a test.
24839edc54
This commit is contained in:
Jan Edmund Lazo
2019-02-17 21:46:42 -05:00
parent 0735893caf
commit a4a024245b

View File

@@ -4,6 +4,7 @@ if !has('multi_byte')
endif endif
source shared.vim source shared.vim
" source screendump.vim
func Test_read_stdin_utf8() func Test_read_stdin_utf8()
let linesin = ['テスト', '€ÀÈÌÒÙ'] let linesin = ['テスト', '€ÀÈÌÒÙ']
@@ -62,3 +63,24 @@ func Test_read_fifo_utf8()
call delete('Xtestout') call delete('Xtestout')
call delete('Xtestin') call delete('Xtestin')
endfunc endfunc
func Test_detect_ambiwidth()
if !CanRunVimInTerminal()
return
endif
" Use the title termcap entries to output the escape sequence.
call writefile([
\ 'set enc=utf-8',
\ 'set ambiwidth=double',
\ 'call test_option_not_set("ambiwidth")',
\ 'redraw',
\ ], 'Xscript')
let buf = RunVimInTerminal('-S Xscript', {})
call term_wait(buf)
call term_sendkeys(buf, "S\<C-R>=&ambiwidth\<CR>\<Esc>")
call WaitForAssert({-> assert_match('single', term_getline(buf, 1))})
call StopVimInTerminal(buf)
call delete('Xscript')
endfunc