aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-04-23 14:15:52 +0200
committerGitHub <noreply@github.com>2023-04-23 14:15:52 +0200
commitf17bb4f41102ecec7989bc4c14c626dc595e2f0b (patch)
tree7e2508e07eff9ece0970048086b01e7148159e60 /test
parentbf0ac4f241cd22f53e026767ed5df89bf63bcf37 (diff)
downloadrneovim-f17bb4f41102ecec7989bc4c14c626dc595e2f0b.tar.gz
rneovim-f17bb4f41102ecec7989bc4c14c626dc595e2f0b.tar.bz2
rneovim-f17bb4f41102ecec7989bc4c14c626dc595e2f0b.zip
vim-patch:9.0.1478: filetypes for *.v files not detected properly (#23282)
* vim-patch:9.0.1478: filetypes for *.v files not detected properly Problem: Filetypes for *.v files not detected properly. Solution: Use the file contents to detect the filetype. (Turiiya, closes vim/vim#12281) https://github.com/vim/vim/commit/80406c26188219f3773b2e9c49160caeeb386ee2 Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com> Co-authored-by: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_filetype.vim22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
index 42b80ba868..789430fc84 100644
--- a/test/old/testdir/test_filetype.vim
+++ b/test/old/testdir/test_filetype.vim
@@ -646,7 +646,6 @@ let s:filename_checks = {
\ 'vdmrt': ['file.vdmrt'],
\ 'vdmsl': ['file.vdm', 'file.vdmsl'],
\ 'vera': ['file.vr', 'file.vri', 'file.vrh'],
- \ 'verilog': ['file.v'],
\ 'verilogams': ['file.va', 'file.vams'],
\ 'vgrindefs': ['vgrindefs'],
\ 'vhdl': ['file.hdl', 'file.vhd', 'file.vhdl', 'file.vbe', 'file.vst', 'file.vhdl_123', 'file.vho', 'some.vhdl_1', 'some.vhdl_1-file'],
@@ -1771,6 +1770,27 @@ func Test_ttl_file()
filetype off
endfunc
+func Test_v_file()
+ filetype on
+
+ call writefile(['module tb; // Looks like a Verilog'], 'Xfile.v', 'D')
+ split Xfile.v
+ call assert_equal('verilog', &filetype)
+ bwipe!
+
+ call writefile(['module main'], 'Xfile.v')
+ split Xfile.v
+ call assert_equal('v', &filetype)
+ bwipe!
+
+ call writefile(['Definition x := 10. (*'], 'Xfile.v')
+ split Xfile.v
+ call assert_equal('coq', &filetype)
+ bwipe!
+
+ filetype off
+endfunc
+
func Test_xpm_file()
filetype on