Mercurial > vim
comparison src/testdir/test_help.vim @ 19289:2f0f308c069c v8.2.0203
patch 8.2.0203: :helptags and some other functionality not tested
Commit: https://github.com/vim/vim/commit/e20b9ececa37a81c0340a78f61e57fa1bf46b06d
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 3 21:40:04 2020 +0100
patch 8.2.0203: :helptags and some other functionality not tested
Problem: :helptags and some other functionality not tested.
Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5567)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 03 Feb 2020 21:45:03 +0100 |
parents | 1b02482e6a61 |
children | 7096af834c42 |
comparison
equal
deleted
inserted
replaced
19288:f061872089a9 | 19289:2f0f308c069c |
---|---|
70 | 70 |
71 func Test_help_completion() | 71 func Test_help_completion() |
72 call feedkeys(":help :undo\<C-A>\<C-B>\"\<CR>", 'tx') | 72 call feedkeys(":help :undo\<C-A>\<C-B>\"\<CR>", 'tx') |
73 call assert_equal('"help :undo :undoj :undol :undojoin :undolist', @:) | 73 call assert_equal('"help :undo :undoj :undol :undojoin :undolist', @:) |
74 endfunc | 74 endfunc |
75 | |
76 " Test for the :helptags command | |
77 func Test_helptag_cmd() | |
78 call mkdir('Xdir/a/doc', 'p') | |
79 | |
80 " No help file to process in the directory | |
81 call assert_fails('helptags Xdir', 'E151:') | |
82 | |
83 call writefile([], 'Xdir/a/doc/sample.txt') | |
84 | |
85 " Test for ++t argument | |
86 helptags ++t Xdir | |
87 call assert_equal(["help-tags\ttags\t1"], readfile('Xdir/tags')) | |
88 call delete('Xdir/tags') | |
89 | |
90 " The following tests fail on FreeBSD for some reason | |
91 if has('unix') && !has('bsd') | |
92 " Read-only tags file | |
93 call writefile([''], 'Xdir/tags') | |
94 call setfperm('Xdir/tags', 'r-xr--r--') | |
95 call assert_fails('helptags Xdir', 'E152:', getfperm('Xdir/tags')) | |
96 call delete('Xdir/tags') | |
97 | |
98 " No permission to read the help file | |
99 call setfperm('Xdir/a/doc/sample.txt', '-w-------') | |
100 call assert_fails('helptags Xdir', 'E153:', getfperm('Xdir/a/doc/sample.txt')) | |
101 call delete('Xdir/a/doc/sample.txt') | |
102 call delete('Xdir/tags') | |
103 endif | |
104 | |
105 " Duplicate tags in the help file | |
106 call writefile(['*tag1*', '*tag1*', '*tag2*'], 'Xdir/a/doc/sample.txt') | |
107 call assert_fails('helptags Xdir', 'E154:') | |
108 | |
109 call delete('Xdir', 'rf') | |
110 endfunc | |
111 | |
112 " vim: shiftwidth=2 sts=2 expandtab |