Mercurial > vim
annotate src/testdir/test_startup_utf8.vim @ 14762:b43ea03bb522 v8.1.0393
patch 8.1.0393: not all white space difference options available
commit https://github.com/vim/vim/commit/785fc6567f572b8caefbc89ec29bbd8b801464ae
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 15 19:17:38 2018 +0200
patch 8.1.0393: not all white space difference options available
Problem: Not all white space difference options available.
Solution: Add "iblank", "iwhiteall" and "iwhiteeol" to 'diffopt'.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 15 Sep 2018 19:30:06 +0200 |
parents | 1e6666885bc0 |
children | 2dcaa860e3fc |
rev | line source |
---|---|
9828
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for startup using utf-8. |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 if !has('multi_byte') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 finish |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 endif |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 source shared.vim |
14750
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
7 source screendump.vim |
9828
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 func Test_read_stdin_utf8() |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 let linesin = ['テスト', '€ÀÈÌÒÙ'] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call writefile(linesin, 'Xtestin') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 let before = [ |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 \ 'set enc=utf-8', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 \ 'set fencs=cp932,utf-8', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 \ ] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 let after = [ |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 \ 'write ++enc=utf-8 Xtestout', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 \ 'quit!', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 \ ] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 if has('win32') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 let pipecmd = 'type Xtestin | ' |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 else |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 let pipecmd = 'cat Xtestin | ' |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 endif |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 if RunVimPiped(before, after, '-', pipecmd) |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 let lines = readfile('Xtestout') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 call assert_equal(linesin, lines) |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 else |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 call assert_equal('', 'RunVimPiped failed.') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 endif |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 call delete('Xtestout') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call delete('Xtestin') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 endfunc |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 func Test_read_fifo_utf8() |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 if !has('unix') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 return |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 endif |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 " Using bash/zsh's process substitution. |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 if executable('bash') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 set shell=bash |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 elseif executable('zsh') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 set shell=zsh |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 else |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 return |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 endif |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 let linesin = ['テスト', '€ÀÈÌÒÙ'] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 call writefile(linesin, 'Xtestin') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 let before = [ |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 \ 'set enc=utf-8', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 \ 'set fencs=cp932,utf-8', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 \ ] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 let after = [ |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 \ 'write ++enc=utf-8 Xtestout', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 \ 'quit!', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 \ ] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 if RunVim(before, after, '<(cat Xtestin)') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 let lines = readfile('Xtestout') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 call assert_equal(linesin, lines) |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 else |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 call assert_equal('', 'RunVim failed.') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 endif |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 call delete('Xtestout') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 call delete('Xtestin') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 endfunc |
14750
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
66 |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
67 func Test_detect_ambiwidth() |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
68 if !CanRunVimInTerminal() |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
69 return |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
70 endif |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
71 |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
72 " Use the title termcap entries to output the escape sequence. |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
73 call writefile([ |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
74 \ 'set enc=utf-8', |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
75 \ 'set ambiwidth=double', |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
76 \ 'call test_option_not_set("ambiwidth")', |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
77 \ 'redraw', |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
78 \ ], 'Xscript') |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
79 let buf = RunVimInTerminal('-S Xscript', {}) |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
80 call term_wait(buf) |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
81 call term_sendkeys(buf, "S\<C-R>=&ambiwidth\<CR>\<Esc>") |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
82 call WaitForAssert({-> assert_match('single', term_getline(buf, 1))}) |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
83 |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
84 call StopVimInTerminal(buf) |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
85 call delete('Xscript') |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
86 endfunc |