Mercurial > vim
annotate src/testdir/test_fnameescape.vim @ 33160:4ecf54d709b3 v9.0.1862
patch 9.0.1862: Vim9 Garbage Collection issues
Commit: https://github.com/vim/vim/commit/e651e110c17656a263dd017b14c85b332163a58d
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Mon Sep 4 07:51:01 2023 +0200
patch 9.0.1862: Vim9 Garbage Collection issues
Problem: Vim9 Garbage Collection issues
Solution: Class members are garbage collected early leading to
use-after-free problems. Handle the garbage
collection of classes properly.
closes: #13019
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 04 Sep 2023 08:00:06 +0200 |
parents | 08940efa6b4e |
children |
rev | line source |
---|---|
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
19231
diff
changeset
|
1 " Test if fnameescape is correct for special chars like ! |
10072
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
10145
diff
changeset
|
3 func Test_fnameescape() |
10072
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 let fname = 'Xspa ce' |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 let status = v:false |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 try |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 exe "w! " . fnameescape(fname) |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 let status = v:true |
10145
eb9a7296ae9f
commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
10072
diff
changeset
|
9 endtry |
10072
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call assert_true(status, "Space") |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call delete(fname) |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 let fname = 'Xemark!' |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 let status = v:false |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 try |
17849
73ddc462979d
patch 8.1.1921: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
16 exe "w! " . fname->fnameescape() |
10072
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 let status = v:true |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 endtry |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call assert_true(status, "ExclamationMark") |
c104f09ae2f4
commit https://github.com/vim/vim/commit/cd055da370114f66c960be9c8b1eb0f33a9e0a85
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 call delete(fname) |
19231
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
17849
diff
changeset
|
21 |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
17849
diff
changeset
|
22 call assert_equal('\-', fnameescape('-')) |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
17849
diff
changeset
|
23 call assert_equal('\+', fnameescape('+')) |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
17849
diff
changeset
|
24 call assert_equal('\>', fnameescape('>')) |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
10145
diff
changeset
|
25 endfunc |
19231
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
17849
diff
changeset
|
26 |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
17849
diff
changeset
|
27 " vim: shiftwidth=2 sts=2 expandtab |