annotate src/testdir/test_file_perm.vim @ 34418:df8faa0124f7 v9.1.0132

patch 9.1.0132: "C" doesn't include composing chars with 'virtualedit' Commit: https://github.com/vim/vim/commit/048761bcd40ec630fd3e039f0066cf4e484ceabd Author: zeertzjq <zeertzjq@outlook.com> Date: Sat Feb 24 14:21:39 2024 +0100 patch 9.1.0132: "C" doesn't include composing chars with 'virtualedit' Problem: using "C" and 've=all' set, doesn't include composing chars when changing a line, keeps the composing chars for whatever is typed afterwards. Solution: Use mb_head_off() and mb_ptr2len() instead of mb_tail_off(). (zeertzjq) closes: #14083 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 24 Feb 2024 14:30:04 +0100
parents a7a9e8b9af89
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8451
c0b5c2b0a5ee commit https://github.com/vim/vim/commit/8049253b96838b3584600e5ad229abad37a95b10
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test getting and setting file permissions.
c0b5c2b0a5ee commit https://github.com/vim/vim/commit/8049253b96838b3584600e5ad229abad37a95b10
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
c0b5c2b0a5ee commit https://github.com/vim/vim/commit/8049253b96838b3584600e5ad229abad37a95b10
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 func Test_file_perm()
30552
a7a9e8b9af89 patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
4 call assert_equal('', getfperm('XtestPerm'))
a7a9e8b9af89 patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
5 call assert_equal(0, 'XtestPerm'->setfperm('r--------'))
8451
c0b5c2b0a5ee commit https://github.com/vim/vim/commit/8049253b96838b3584600e5ad229abad37a95b10
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
30552
a7a9e8b9af89 patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
7 call writefile(['one'], 'XtestPerm', 'D')
a7a9e8b9af89 patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
8 call assert_true(len('XtestPerm'->getfperm()) == 9)
8451
c0b5c2b0a5ee commit https://github.com/vim/vim/commit/8049253b96838b3584600e5ad229abad37a95b10
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9
30552
a7a9e8b9af89 patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
10 call assert_equal(1, setfperm('XtestPerm', 'rwx------'))
8461
988ddc5742f5 commit https://github.com/vim/vim/commit/8322e1f06e8fa39a6bb790a7d8d7db5d7aff3366
Christian Brabandt <cb@256bit.org>
parents: 8451
diff changeset
11 if has('win32')
30552
a7a9e8b9af89 patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
12 call assert_equal('rw-rw-rw-', getfperm('XtestPerm'))
8461
988ddc5742f5 commit https://github.com/vim/vim/commit/8322e1f06e8fa39a6bb790a7d8d7db5d7aff3366
Christian Brabandt <cb@256bit.org>
parents: 8451
diff changeset
13 else
30552
a7a9e8b9af89 patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
14 call assert_equal('rwx------', getfperm('XtestPerm'))
8461
988ddc5742f5 commit https://github.com/vim/vim/commit/8322e1f06e8fa39a6bb790a7d8d7db5d7aff3366
Christian Brabandt <cb@256bit.org>
parents: 8451
diff changeset
15 endif
8451
c0b5c2b0a5ee commit https://github.com/vim/vim/commit/8049253b96838b3584600e5ad229abad37a95b10
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16
30552
a7a9e8b9af89 patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
17 call assert_equal(1, setfperm('XtestPerm', 'r--r--r--'))
a7a9e8b9af89 patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
18 call assert_equal('r--r--r--', getfperm('XtestPerm'))
8451
c0b5c2b0a5ee commit https://github.com/vim/vim/commit/8049253b96838b3584600e5ad229abad37a95b10
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19
30552
a7a9e8b9af89 patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
20 call assert_fails("setfperm('XtestPerm', '---')")
8451
c0b5c2b0a5ee commit https://github.com/vim/vim/commit/8049253b96838b3584600e5ad229abad37a95b10
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
30552
a7a9e8b9af89 patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
22 call assert_equal(1, setfperm('XtestPerm', 'rwx------'))
19783
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 17857
diff changeset
23
30051
13b02c1ea0f7 patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents: 19783
diff changeset
24 call assert_fails("call setfperm(['Xpermfile'], 'rw-rw-rw-')", 'E730:')
13b02c1ea0f7 patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents: 19783
diff changeset
25 call assert_fails("call setfperm('Xpermfile', [])", 'E730:')
13b02c1ea0f7 patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents: 19783
diff changeset
26 call assert_fails("call setfperm('Xpermfile', 'rwxrwxrwxrw')", 'E475:')
8451
c0b5c2b0a5ee commit https://github.com/vim/vim/commit/8049253b96838b3584600e5ad229abad37a95b10
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 endfunc
19783
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 17857
diff changeset
28
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 17857
diff changeset
29 " vim: shiftwidth=2 sts=2 expandtab