From a6803f3adfc8b493c9e76343cc78f99ca8c1d3c9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 8 Jul 2022 14:15:59 +0800 Subject: test: add a test for what Vim patch 8.2.0151 fixes --- test/functional/ex_cmds/source_spec.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/functional') diff --git a/test/functional/ex_cmds/source_spec.lua b/test/functional/ex_cmds/source_spec.lua index fa650d611b..13a40fcc53 100644 --- a/test/functional/ex_cmds/source_spec.lua +++ b/test/functional/ex_cmds/source_spec.lua @@ -19,6 +19,26 @@ describe(':source', function() clear() end) + it('sourcing a file that is deleted and recreated is consistent vim-patch:8.1.0151', function() + local test_file = 'Xfile.vim' + local other_file = 'Xfoobar' + local script = [[ + func Func() + endfunc + ]] + write_file(test_file, script) + command('source ' .. test_file) + os.remove(test_file) + write_file(test_file, script) + command('source ' .. test_file) + os.remove(test_file) + write_file(other_file, '') + write_file(test_file, script) + command('source ' .. test_file) + os.remove(other_file) + os.remove(test_file) + end) + it('current buffer', function() insert([[ let a = 2 -- cgit