aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-11-22 19:16:54 +0800
committerGitHub <noreply@github.com>2024-11-22 11:16:54 +0000
commitc697c49a769794fdab0b8e77bb69d4435faa3d24 (patch)
treec95874436f7baffa1cc1dcd8072949bf7e3a22a3
parent7d8db544417e7811ae6e3c5398e9d0481a0ada22 (diff)
downloadrneovim-c697c49a769794fdab0b8e77bb69d4435faa3d24.tar.gz
rneovim-c697c49a769794fdab0b8e77bb69d4435faa3d24.tar.bz2
rneovim-c697c49a769794fdab0b8e77bb69d4435faa3d24.zip
test(filetype): symlink detection works after expand('<afile>') (#31307)
Also add a test for #31306, which currently fails.
-rw-r--r--test/functional/lua/filetype_spec.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/functional/lua/filetype_spec.lua b/test/functional/lua/filetype_spec.lua
index b6011d5268..6a4f8d70f3 100644
--- a/test/functional/lua/filetype_spec.lua
+++ b/test/functional/lua/filetype_spec.lua
@@ -199,7 +199,19 @@ describe('filetype.lua', function()
finally(function()
uv.fs_unlink('Xfiletype/.config/git')
end)
- clear({ args = { '--clean', 'Xfiletype/.config/git/config' } })
+ local args = { '--clean', 'Xfiletype/.config/git/config' }
+ clear({ args = args })
eq('gitconfig', api.nvim_get_option_value('filetype', {}))
+ table.insert(args, 2, '--cmd')
+ table.insert(args, 3, "autocmd BufRead * call expand('<afile>')")
+ clear({ args = args })
+ eq('gitconfig', api.nvim_get_option_value('filetype', {}))
+ end)
+
+ pending('works with :doautocmd BufRead #31306', function()
+ clear({ args = { '--clean' } })
+ eq('', api.nvim_get_option_value('filetype', {}))
+ command('doautocmd BufRead README.md')
+ eq('markdown', api.nvim_get_option_value('filetype', {}))
end)
end)