From 09b7163f5d942339475a4977253920c4ae7e1297 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 18 Dec 2020 22:12:53 -0500 Subject: vim-patch:8.2.0262: fileformat test fails on MS-Windows Problem: Fileformat test fails on MS-Windows. Solution: Set fileformat of buffer. https://github.com/vim/vim/commit/50434bd74c7708e3e2a47449b6a3a8d9fa069f71 Cherry-pick Test_fileformat_plusplus_read() from patch v8.2.0261. --- src/nvim/testdir/test_fileformat.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_fileformat.vim b/src/nvim/testdir/test_fileformat.vim index 8dc25f62b1..3de7d38831 100644 --- a/src/nvim/testdir/test_fileformat.vim +++ b/src/nvim/testdir/test_fileformat.vim @@ -31,3 +31,26 @@ func Test_fileformat_autocommand() au! BufReadPre Xfile bw! endfunc + +" Test for changing the fileformat using ++read +func Test_fileformat_plusplus_read() + new + call setline(1, ['one', 'two', 'three']) + set ff=unix + w ++ff=dos Xfile1 + enew! + " A :read doesn't change the fileformat, but does apply to the read lines. + r ++fileformat=unix Xfile1 + call assert_equal('unix', &fileformat) + call assert_equal("three\r", getline('$')) + 3r ++edit Xfile1 + call assert_equal('dos', &fileformat) + close! + call delete('Xfile1') + set fileformat& + call assert_fails('e ++fileformat Xfile1', 'E474:') + call assert_fails('e ++ff=abc Xfile1', 'E474:') + call assert_fails('e ++abc1 Xfile1', 'E474:') +endfunc + +" vim: shiftwidth=2 sts=2 expandtab -- cgit From b35061fb64d7f135cc0e5e45f8b3359fb10c352b Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 18 Dec 2020 22:15:27 -0500 Subject: vim-patch:8.2.0264: fileformat test still fails on MS-Windows Problem: Fileformat test still fails on MS-Windows. Solution: Set fileformat of buffer in the right place. https://github.com/vim/vim/commit/a36c830a32f439b862ffb85d4c4b4799ee5ea2f9 --- src/nvim/testdir/test_fileformat.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_fileformat.vim b/src/nvim/testdir/test_fileformat.vim index 3de7d38831..465613f1cf 100644 --- a/src/nvim/testdir/test_fileformat.vim +++ b/src/nvim/testdir/test_fileformat.vim @@ -36,9 +36,9 @@ endfunc func Test_fileformat_plusplus_read() new call setline(1, ['one', 'two', 'three']) - set ff=unix w ++ff=dos Xfile1 enew! + set ff=unix " A :read doesn't change the fileformat, but does apply to the read lines. r ++fileformat=unix Xfile1 call assert_equal('unix', &fileformat) -- cgit From 5491a728fea0ab1bcc6d4f3ac2e2003e46008ae3 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 19 Dec 2020 01:36:47 -0500 Subject: vim-patch:8.2.0272: ":helptags ALL" gives error for some directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/nvim/testdir/test_help.vim | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'src/nvim/testdir') 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 -- cgit