aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-02-17 21:46:42 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-02-17 21:47:12 -0500
commita4a024245ba28480a46772d762e3d62b9f682029 (patch)
treea8e9b049d3e9d766f5d5e99026b3c8d98187467c
parent0735893caf90b85c7304659a0c8a02706d5a745c (diff)
downloadrneovim-a4a024245ba28480a46772d762e3d62b9f682029.tar.gz
rneovim-a4a024245ba28480a46772d762e3d62b9f682029.tar.bz2
rneovim-a4a024245ba28480a46772d762e3d62b9f682029.zip
vim-patch:8.1.0387: no test for 'ambiwidth' detection
Problem: No test for 'ambiwidth' detection. Solution: Add a test. https://github.com/vim/vim/commit/24839edc54e985ed88d063513226922a6f5b7554
-rw-r--r--src/nvim/testdir/test_startup_utf8.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_startup_utf8.vim b/src/nvim/testdir/test_startup_utf8.vim
index d179a4cc79..f824925450 100644
--- a/src/nvim/testdir/test_startup_utf8.vim
+++ b/src/nvim/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