]> granicus.if.org Git - vim/commitdiff
patch 8.1.0387: no test for 'ambiwidth' detection v8.1.0387
authorBram Moolenaar <Bram@vim.org>
Thu, 13 Sep 2018 18:46:52 +0000 (20:46 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 13 Sep 2018 18:46:52 +0000 (20:46 +0200)
Problem:    No test for 'ambiwidth' detection.
Solution:   Add a test.

src/testdir/test_startup_utf8.vim
src/version.c

index d179a4cc793e3248257148ad2b3cdd4311a27fde..ef1a997ea45cc854366d8556bafa477e66872466 100644 (file)
@@ -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
index 81fc68555f44c6b45d37cfc8ab8125856f41051e..9b2e81b12535ac3cf393ccf49f11b9f2d4736ab8 100644 (file)
@@ -794,6 +794,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    387,
 /**/
     386,
 /**/