From 52f00a6c4d84a13a85ff265a5c59c92795d1b333 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 26 Aug 2022 20:03:08 +0800 Subject: vim-patch:9.0.0274: netrw plugin does not show remote files Problem: Netrw plugin does not show remote files. Solution: Do read a file when 'buftype' is "acwrite". (closes vim/vim#10983) https://github.com/vim/vim/commit/c312619f7c0cf590d96e0b2ed891d1f6c43d769b --- src/nvim/testdir/test_functions.vim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/nvim/testdir/test_functions.vim') diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index b1f617ceda..555c4f58b7 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1887,6 +1887,13 @@ func Test_bufadd_bufload() call bufload(buf) call assert_equal([''], getbufline(buf, 1, '$')) + " when 'buftype' is "acwrite" then bufload() DOES read the file + bwipe! XotherName + let buf = bufadd('XotherName') + call setbufvar(buf, '&bt', 'acwrite') + call bufload(buf) + call assert_equal(['some', 'text'], getbufline(buf, 1, '$')) + bwipe someName bwipe XotherName call assert_equal(0, bufexists('someName')) -- cgit From d813ef0097eb781baeba5d458dcb0507e2f61040 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 26 Aug 2022 22:39:13 +0800 Subject: vim-patch:9.0.0276: 'buftype' values not sufficiently tested Problem: 'buftype' values not sufficiently tested. Solution: Add and extend tests with 'buftype' values. (closes vim/vim#10988) https://github.com/vim/vim/commit/93f72cc119c796f1ccb75468ef9e446cbfb41e9b "terminal" and "popup" buffer types cannot be tested, and commenting them out causes an error, so just remove them. --- src/nvim/testdir/test_functions.vim | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/nvim/testdir/test_functions.vim') diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index 555c4f58b7..147eda5b0a 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1880,19 +1880,21 @@ func Test_bufadd_bufload() exe 'bwipe ' .. buf2 call assert_equal(0, bufexists(buf2)) - " when 'buftype' is "nofile" then bufload() does not read the file - bwipe! XotherName - let buf = bufadd('XotherName') - call setbufvar(buf, '&bt', 'nofile') - call bufload(buf) - call assert_equal([''], getbufline(buf, 1, '$')) - - " when 'buftype' is "acwrite" then bufload() DOES read the file - bwipe! XotherName - let buf = bufadd('XotherName') - call setbufvar(buf, '&bt', 'acwrite') - call bufload(buf) - call assert_equal(['some', 'text'], getbufline(buf, 1, '$')) + " When 'buftype' is "nofile" then bufload() does not read the file. + " Other values too. + for val in [['nofile', 0], + \ ['nowrite', 1], + \ ['acwrite', 1], + \ ['quickfix', 0], + \ ['help', 1], + \ ['prompt', 0], + \ ] + bwipe! XotherName + let buf = bufadd('XotherName') + call setbufvar(buf, '&bt', val[0]) + call bufload(buf) + call assert_equal(val[1] ? ['some', 'text'] : [''], getbufline(buf, 1, '$'), val[0]) + endfor bwipe someName bwipe XotherName -- cgit