Mercurial > vim
annotate src/testdir/test_startup_utf8.vim @ 21287:3fd32bf5fff0 v8.2.1194
patch 8.2.1194: test failure because shell prompt differs
Commit: https://github.com/vim/vim/commit/a4dc6f92bb29b00783f8945bbe1101e837b6ad3c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 12 19:52:36 2020 +0200
patch 8.2.1194: test failure because shell prompt differs
Problem: Test failure because shell prompt differs.
Solution: Set the shell prompt.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 12 Jul 2020 20:00:03 +0200 |
parents | 1e2e81dbb958 |
children | 08940efa6b4e |
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 |
20768
1e2e81dbb958
patch 8.2.0936: some terminals misinterpret the code for getting cursor style
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
3 source check.vim |
9828
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 source shared.vim |
14750
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
5 source screendump.vim |
9828
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 func Test_read_stdin_utf8() |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 let linesin = ['テスト', '€ÀÈÌÒÙ'] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call writefile(linesin, 'Xtestin') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 let before = [ |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 \ 'set enc=utf-8', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 \ 'set fencs=cp932,utf-8', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 \ ] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 let after = [ |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 \ 'write ++enc=utf-8 Xtestout', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 \ 'quit!', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 \ ] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 if has('win32') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 let pipecmd = 'type Xtestin | ' |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 else |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 let pipecmd = 'cat Xtestin | ' |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 endif |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 if RunVimPiped(before, after, '-', pipecmd) |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 let lines = readfile('Xtestout') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 call assert_equal(linesin, lines) |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 else |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 call assert_equal('', 'RunVimPiped failed.') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 endif |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 call delete('Xtestout') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 call delete('Xtestin') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 endfunc |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 func Test_read_fifo_utf8() |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 if !has('unix') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 return |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 endif |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 " Using bash/zsh's process substitution. |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 if executable('bash') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 set shell=bash |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 elseif executable('zsh') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 set shell=zsh |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 else |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 return |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 endif |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 let linesin = ['テスト', '€ÀÈÌÒÙ'] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 call writefile(linesin, 'Xtestin') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 let before = [ |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 \ 'set enc=utf-8', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 \ 'set fencs=cp932,utf-8', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 \ ] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 let after = [ |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 \ 'write ++enc=utf-8 Xtestout', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 \ 'quit!', |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 \ ] |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 if RunVim(before, after, '<(cat Xtestin)') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 let lines = readfile('Xtestout') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 call assert_equal(linesin, lines) |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 else |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 call assert_equal('', 'RunVim failed.') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 endif |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 call delete('Xtestout') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 call delete('Xtestin') |
e84e45786691
commit https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 endfunc |
14750
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
64 |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
65 func Test_detect_ambiwidth() |
20625
116c7bd5e980
patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
66 CheckRunVimInTerminal |
14750
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
67 |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
68 " 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
|
69 call writefile([ |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
70 \ 'set enc=utf-8', |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
71 \ 'set ambiwidth=double', |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
72 \ '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
|
73 \ 'redraw', |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
74 \ ], 'Xscript') |
20768
1e2e81dbb958
patch 8.2.0936: some terminals misinterpret the code for getting cursor style
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
75 let buf = RunVimInTerminal('-S Xscript', #{keep_t_u7: 1}) |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
16965
diff
changeset
|
76 call TermWait(buf) |
14750
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
77 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
|
78 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
|
79 |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
80 call StopVimInTerminal(buf) |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
81 call delete('Xscript') |
1e6666885bc0
patch 8.1.0387: no test for 'ambiwidth' detection
Christian Brabandt <cb@256bit.org>
parents:
9828
diff
changeset
|
82 endfunc |