Mercurial > vim
annotate src/testdir/test_escaped_glob.vim @ 16235:219c58b3879c v8.1.1122
patch 8.1.1122: char2nr() does not handle composing characters
commit https://github.com/vim/vim/commit/9d40128afd7fcd038ff6532722b55b1a8c189ce8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 6 13:18:12 2019 +0200
patch 8.1.1122: char2nr() does not handle composing characters
Problem: char2nr() does not handle composing characters.
Solution: Add str2list() and list2str(). (Ozaki Kiichi, closes https://github.com/vim/vim/issues/4190)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 06 Apr 2019 13:30:04 +0200 |
parents | b1df7f99efb7 |
children | 5ef25fa57f71 |
rev | line source |
---|---|
11651
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test whether glob()/globpath() return correct results with certain escaped |
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 " characters. |
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 |
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 function SetUp() |
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 " consistent sorting of file names |
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 set nofileignorecase |
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 endfunction |
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 |
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 function Test_glob() |
12899
9e04de2aa738
patch 8.0.1326: largefile test fails on CI, glob test on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
11651
diff
changeset
|
10 if !has('unix') |
9e04de2aa738
patch 8.0.1326: largefile test fails on CI, glob test on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
11651
diff
changeset
|
11 " This test fails on Windows because of the special characters in the |
9e04de2aa738
patch 8.0.1326: largefile test fails on CI, glob test on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
11651
diff
changeset
|
12 " filenames. Disable the test on non-Unix systems for now. |
9e04de2aa738
patch 8.0.1326: largefile test fails on CI, glob test on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
11651
diff
changeset
|
13 return |
9e04de2aa738
patch 8.0.1326: largefile test fails on CI, glob test on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
11651
diff
changeset
|
14 endif |
14929
b1df7f99efb7
patch 8.1.0476: memory leaks in test_escaped_glob
Bram Moolenaar <Bram@vim.org>
parents:
13002
diff
changeset
|
15 |
b1df7f99efb7
patch 8.1.0476: memory leaks in test_escaped_glob
Bram Moolenaar <Bram@vim.org>
parents:
13002
diff
changeset
|
16 " Execute these commands in the sandbox, so that using the shell fails. |
b1df7f99efb7
patch 8.1.0476: memory leaks in test_escaped_glob
Bram Moolenaar <Bram@vim.org>
parents:
13002
diff
changeset
|
17 " Setting 'shell' to an invalid name causes a memory leak. |
b1df7f99efb7
patch 8.1.0476: memory leaks in test_escaped_glob
Bram Moolenaar <Bram@vim.org>
parents:
13002
diff
changeset
|
18 sandbox call assert_equal("", glob('Xxx\{')) |
b1df7f99efb7
patch 8.1.0476: memory leaks in test_escaped_glob
Bram Moolenaar <Bram@vim.org>
parents:
13002
diff
changeset
|
19 sandbox call assert_equal("", glob('Xxx\$')) |
11651
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 w! Xxx{ |
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 w! Xxx\$ |
14929
b1df7f99efb7
patch 8.1.0476: memory leaks in test_escaped_glob
Bram Moolenaar <Bram@vim.org>
parents:
13002
diff
changeset
|
22 sandbox call assert_equal("Xxx{", glob('Xxx\{')) |
b1df7f99efb7
patch 8.1.0476: memory leaks in test_escaped_glob
Bram Moolenaar <Bram@vim.org>
parents:
13002
diff
changeset
|
23 sandbox call assert_equal("Xxx$", glob('Xxx\$')) |
12899
9e04de2aa738
patch 8.0.1326: largefile test fails on CI, glob test on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
11651
diff
changeset
|
24 call delete('Xxx{') |
9e04de2aa738
patch 8.0.1326: largefile test fails on CI, glob test on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
11651
diff
changeset
|
25 call delete('Xxx$') |
11651
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 endfunction |
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 |
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 function Test_globpath() |
14929
b1df7f99efb7
patch 8.1.0476: memory leaks in test_escaped_glob
Bram Moolenaar <Bram@vim.org>
parents:
13002
diff
changeset
|
29 sandbox call assert_equal("sautest/autoload/globone.vim\nsautest/autoload/globtwo.vim", |
13002
f7b2ecaeb79c
patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
12899
diff
changeset
|
30 \ globpath('sautest/autoload', 'glob*.vim')) |
14929
b1df7f99efb7
patch 8.1.0476: memory leaks in test_escaped_glob
Bram Moolenaar <Bram@vim.org>
parents:
13002
diff
changeset
|
31 sandbox call assert_equal(['sautest/autoload/globone.vim', 'sautest/autoload/globtwo.vim'], |
13002
f7b2ecaeb79c
patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
12899
diff
changeset
|
32 \ globpath('sautest/autoload', 'glob*.vim', 0, 1)) |
11651
140d51d5b5c3
patch 8.0.0708: some tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 endfunction |