Mercurial > vim
annotate src/testdir/test_makeencoding.vim @ 33811:06219b3bdaf3 v9.0.2121
patch 9.0.2121: [security]: use-after-free in ex_substitute
Commit: https://github.com/vim/vim/commit/26c11c56888d01e298cd8044caf860f3c26f57bb
Author: Christian Brabandt <cb@256bit.org>
Date: Wed Nov 22 21:26:41 2023 +0100
patch 9.0.2121: [security]: use-after-free in ex_substitute
Problem: [security]: use-after-free in ex_substitute
Solution: always allocate memory
closes: #13552
A recursive :substitute command could cause a heap-use-after free in Vim
(CVE-2023-48706).
The whole reproducible test is a bit tricky, I can only reproduce this
reliably when no previous substitution command has been used yet
(which is the reason, the test needs to run as first one in the
test_substitute.vim file) and as a combination of the `:~` command
together with a :s command that contains the special substitution atom `~\=`
which will make use of a sub-replace special atom and calls a vim script
function.
There was a comment in the existing :s code, that already makes the
`sub` variable allocate memory so that a recursive :s call won't be able
to cause any issues here, so this was known as a potential problem
already. But for the current test-case that one does not work, because
the substitution does not start with `\=` but with `~\=` (and since
there does not yet exist a previous substitution atom, Vim will simply
increment the `sub` pointer (which then was not allocated dynamically)
and later one happily use a sub-replace special expression (which could
then free the `sub` var).
The following commit fixes this, by making the sub var always using
allocated memory, which also means we need to free the pointer whenever
we leave the function. Since sub is now always an allocated variable,
we also do no longer need the sub_copy variable anymore, since this one
was used to indicated when sub pointed to allocated memory (and had
therefore to be freed on exit) and when not.
Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-c8qm-x72m-q53q
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 22 Nov 2023 22:15:05 +0100 |
parents | d1af65b322d0 |
children |
rev | line source |
---|---|
11063
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for 'makeencoding'. |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 source shared.vim |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
4 source check.vim |
11063
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
6 CheckFeature quickfix |
11063
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 let s:python = PythonProg() |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 if s:python == '' |
17089
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
17049
diff
changeset
|
9 throw 'Skipped: python program missing' |
11063
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 endif |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 let s:script = 'test_makeencoding.py' |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 let s:message_tbl = { |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 \ 'utf-8': 'ÀÈÌÒÙ こんにちは 你好', |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 \ 'latin1': 'ÀÈÌÒÙ', |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 \ 'cp932': 'こんにちは', |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 \ 'cp936': '你好', |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 \} |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 " Tests for :cgetfile and :lgetfile. |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 func Test_getfile() |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 set errorfile=Xerror.txt |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 set errorformat=%f(%l)\ :\ %m |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 " :cgetfile |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 for enc in keys(s:message_tbl) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 let &makeencoding = enc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 exec "silent !" . s:python . " " . s:script . " " . enc . " > " . &errorfile |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 cgetfile |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 copen |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")", |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 \ getline('.')) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 cclose |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 endfor |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 " :lgetfile |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 for enc in keys(s:message_tbl) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 let &makeencoding = enc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 exec "silent !" . s:python . " " . s:script . " " . enc . " > " . &errorfile |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 lgetfile |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 lopen |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")", |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 \ getline('.')) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 lclose |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 endfor |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 call delete(&errorfile) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 endfunc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 " Tests for :grep and :lgrep. |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 func Test_grep() |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 let &grepprg = s:python |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 set grepformat=%f(%l)\ :\ %m |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 " :grep |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 for enc in keys(s:message_tbl) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 let &makeencoding = enc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 exec "silent grep! " . s:script . " " . enc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 copen |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")", |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 \ getline('.')) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 cclose |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 endfor |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 " :lgrep |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 for enc in keys(s:message_tbl) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 let &makeencoding = enc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 exec "silent lgrep! " . s:script . " " . enc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 lopen |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")", |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 \ getline('.')) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 lclose |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 endfor |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 endfunc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 " Tests for :make and :lmake. |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 func Test_make() |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 let &makeprg = s:python |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 set errorformat=%f(%l)\ :\ %m |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 " :make |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 for enc in keys(s:message_tbl) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 let &makeencoding = enc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 exec "silent make! " . s:script . " " . enc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 copen |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")", |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 \ getline('.')) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 cclose |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 endfor |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 " :lmake |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 for enc in keys(s:message_tbl) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 let &makeencoding = enc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 exec "silent lmake! " . s:script . " " . enc |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 lopen |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")", |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 \ getline('.')) |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 lclose |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 endfor |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 endfunc |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
105 |
27873
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
106 " Test for an error file with a long line that needs an encoding conversion |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
107 func Test_longline_conversion() |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
108 new |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
109 call setline(1, ['Xfile:10:' .. repeat("\xe0", 2000)]) |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
110 write ++enc=latin1 Xerr.out |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
111 bw! |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
112 set errorformat& |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
113 set makeencoding=latin1 |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
114 cfile Xerr.out |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
115 call assert_equal(repeat("\u00e0", 2000), getqflist()[0].text) |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
116 call delete('Xerr.out') |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
117 set makeencoding& |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
118 endfunc |
d1af65b322d0
patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
119 |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
120 " vim: shiftwidth=2 sts=2 expandtab |