diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-12-19 01:36:47 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-12-19 10:39:15 -0500 |
commit | 5491a728fea0ab1bcc6d4f3ac2e2003e46008ae3 (patch) | |
tree | 3c1c75c910495c857b2e76e744bf772651b27c14 /src/nvim/testdir | |
parent | 945ae2c72b37d58980e1fc73b04a3f3fa155ff27 (diff) | |
download | rneovim-5491a728fea0ab1bcc6d4f3ac2e2003e46008ae3.tar.gz rneovim-5491a728fea0ab1bcc6d4f3ac2e2003e46008ae3.tar.bz2 rneovim-5491a728fea0ab1bcc6d4f3ac2e2003e46008ae3.zip |
vim-patch:8.2.0272: ":helptags ALL" gives error for some directories
Problem: ":helptags ALL" gives error for directories without write
permission. (Matěj Cepl)
Solution: Ignore errors for ":helptags ALL". (Ken Takata, closes vim/vim#5026,
closes vim/vim#5652)
https://github.com/vim/vim/commit/414b79662786762256e756ece8ab4aaecbbf9bd1
Cherry-pick Test_helptag_cmd() from patch v8.2.0203.
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_help.vim | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_help.vim b/src/nvim/testdir/test_help.vim index 01fb9917e9..8e59efd22d 100644 --- a/src/nvim/testdir/test_help.vim +++ b/src/nvim/testdir/test_help.vim @@ -56,3 +56,49 @@ func Test_help_local_additions() call delete('Xruntime', 'rf') let &rtp = rtp_save endfunc + +" Test for the :helptags command +func Test_helptag_cmd() + call mkdir('Xdir/a/doc', 'p') + + " No help file to process in the directory + call assert_fails('helptags Xdir', 'E151:') + + call writefile([], 'Xdir/a/doc/sample.txt') + + " Test for ++t argument + helptags ++t Xdir + call assert_equal(["help-tags\ttags\t1"], readfile('Xdir/tags')) + call delete('Xdir/tags') + + " The following tests fail on FreeBSD for some reason + if has('unix') && !has('bsd') + " Read-only tags file + call mkdir('Xdir/doc', 'p') + call writefile([''], 'Xdir/doc/tags') + call writefile([], 'Xdir/doc/sample.txt') + call setfperm('Xdir/doc/tags', 'r-xr--r--') + call assert_fails('helptags Xdir/doc', 'E152:', getfperm('Xdir/doc/tags')) + + let rtp = &rtp + let &rtp = 'Xdir' + helptags ALL + let &rtp = rtp + + call delete('Xdir/doc/tags') + + " No permission to read the help file + call setfperm('Xdir/a/doc/sample.txt', '-w-------') + call assert_fails('helptags Xdir', 'E153:', getfperm('Xdir/a/doc/sample.txt')) + call delete('Xdir/a/doc/sample.txt') + call delete('Xdir/tags') + endif + + " Duplicate tags in the help file + call writefile(['*tag1*', '*tag1*', '*tag2*'], 'Xdir/a/doc/sample.txt') + call assert_fails('helptags Xdir', 'E154:') + + call delete('Xdir', 'rf') +endfunc + +" vim: shiftwidth=2 sts=2 expandtab |