aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_source.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-08 20:12:58 +0800
committerGitHub <noreply@github.com>2022-07-08 20:12:58 +0800
commitb999de2eb019af88cd01b4e95480b784a71228eb (patch)
treefc0d0af9efc6a492360cca6db991b1e0fd451e51 /src/nvim/testdir/test_source.vim
parentca64b589cd74e9f6bd369286a415711ec7197082 (diff)
parenta6803f3adfc8b493c9e76343cc78f99ca8c1d3c9 (diff)
downloadrneovim-b999de2eb019af88cd01b4e95480b784a71228eb.tar.gz
rneovim-b999de2eb019af88cd01b4e95480b784a71228eb.tar.bz2
rneovim-b999de2eb019af88cd01b4e95480b784a71228eb.zip
Merge pull request #19278 from zeertzjq/vim-8.2.0132
vim-patch:8.2.{0132,0136,0151}: detecting a script was already sourced is unreliable
Diffstat (limited to 'src/nvim/testdir/test_source.vim')
-rw-r--r--src/nvim/testdir/test_source.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_source.vim b/src/nvim/testdir/test_source.vim
index 09baec0b7d..b8fe8422b3 100644
--- a/src/nvim/testdir/test_source.vim
+++ b/src/nvim/testdir/test_source.vim
@@ -46,3 +46,14 @@ func Test_source_sandbox()
bwipe!
call delete('Xsourcehello')
endfunc
+
+" When deleting a file and immediately creating a new one the inode may be
+" recycled. Vim should not recognize it as the same script.
+func Test_different_script()
+ call writefile(['let s:var = "asdf"'], 'XoneScript')
+ source XoneScript
+ call delete('XoneScript')
+ call writefile(['let g:var = s:var'], 'XtwoScript')
+ call assert_fails('source XtwoScript', 'E121:')
+ call delete('XtwoScript')
+endfunc