Mercurial > vim
comparison src/testdir/test_startup_utf8.vim @ 14750:1e6666885bc0 v8.1.0387
patch 8.1.0387: no test for 'ambiwidth' detection
commit https://github.com/vim/vim/commit/24839edc54e985ed88d063513226922a6f5b7554
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 13 20:46:52 2018 +0200
patch 8.1.0387: no test for 'ambiwidth' detection
Problem: No test for 'ambiwidth' detection.
Solution: Add a test.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 13 Sep 2018 21:00:06 +0200 |
parents | e84e45786691 |
children | 2dcaa860e3fc |
comparison
equal
deleted
inserted
replaced
14749:706a5bcea803 | 14750:1e6666885bc0 |
---|---|
2 if !has('multi_byte') | 2 if !has('multi_byte') |
3 finish | 3 finish |
4 endif | 4 endif |
5 | 5 |
6 source shared.vim | 6 source shared.vim |
7 source screendump.vim | |
7 | 8 |
8 func Test_read_stdin_utf8() | 9 func Test_read_stdin_utf8() |
9 let linesin = ['テスト', '€ÀÈÌÒÙ'] | 10 let linesin = ['テスト', '€ÀÈÌÒÙ'] |
10 call writefile(linesin, 'Xtestin') | 11 call writefile(linesin, 'Xtestin') |
11 let before = [ | 12 let before = [ |
60 call assert_equal('', 'RunVim failed.') | 61 call assert_equal('', 'RunVim failed.') |
61 endif | 62 endif |
62 call delete('Xtestout') | 63 call delete('Xtestout') |
63 call delete('Xtestin') | 64 call delete('Xtestin') |
64 endfunc | 65 endfunc |
66 | |
67 func Test_detect_ambiwidth() | |
68 if !CanRunVimInTerminal() | |
69 return | |
70 endif | |
71 | |
72 " Use the title termcap entries to output the escape sequence. | |
73 call writefile([ | |
74 \ 'set enc=utf-8', | |
75 \ 'set ambiwidth=double', | |
76 \ 'call test_option_not_set("ambiwidth")', | |
77 \ 'redraw', | |
78 \ ], 'Xscript') | |
79 let buf = RunVimInTerminal('-S Xscript', {}) | |
80 call term_wait(buf) | |
81 call term_sendkeys(buf, "S\<C-R>=&ambiwidth\<CR>\<Esc>") | |
82 call WaitForAssert({-> assert_match('single', term_getline(buf, 1))}) | |
83 | |
84 call StopVimInTerminal(buf) | |
85 call delete('Xscript') | |
86 endfunc |