summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_startup_utf8.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-09-13 20:46:52 +0200
committerBram Moolenaar <Bram@vim.org>2018-09-13 20:46:52 +0200
commit24839edc54e985ed88d063513226922a6f5b7554 (patch)
tree6ed3d2a045755d4bbd94a587a5edec375a0f7504 /src/testdir/test_startup_utf8.vim
parentfe8ef98dd1d0b7d296d7db29b1e2fd1b56b788de (diff)
patch 8.1.0387: no test for 'ambiwidth' detectionv8.1.0387
Problem: No test for 'ambiwidth' detection. Solution: Add a test.
Diffstat (limited to 'src/testdir/test_startup_utf8.vim')
-rw-r--r--src/testdir/test_startup_utf8.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_startup_utf8.vim b/src/testdir/test_startup_utf8.vim
index d179a4cc79..ef1a997ea4 100644
--- a/src/testdir/test_startup_utf8.vim
+++ b/src/testdir/test_startup_utf8.vim
@@ -4,6 +4,7 @@ if !has('multi_byte')
endif
source shared.vim
+source screendump.vim
func Test_read_stdin_utf8()
let linesin = ['テスト', '€ÀÈÌÒÙ']
@@ -62,3 +63,24 @@ func Test_read_fifo_utf8()
call delete('Xtestout')
call delete('Xtestin')
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