summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_filetype.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_filetype.vim')
-rw-r--r--src/testdir/test_filetype.vim59
1 files changed, 52 insertions, 7 deletions
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index f8fe9ec..d0a078f 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -131,7 +131,7 @@ def s:GetFilenameChecks(): dict<list<string>>
bst: ['file.bst'],
bzl: ['file.bazel', 'file.bzl', 'WORKSPACE', 'WORKSPACE.bzlmod'],
bzr: ['bzr_log.any', 'bzr_log.file'],
- c: ['enlightenment/file.cfg', 'file.qc', 'file.c', 'some-enlightenment/file.cfg'],
+ c: ['enlightenment/file.cfg', 'file.qc', 'file.c', 'some-enlightenment/file.cfg', 'file.mdh', 'file.epro'],
cabal: ['file.cabal'],
cabalconfig: ['cabal.config', expand("$HOME/.config/cabal/config")] + WhenConfigHome('$XDG_CONFIG_HOME/cabal/config'),
cabalproject: ['cabal.project', 'cabal.project.local'],
@@ -336,6 +336,7 @@ def s:GetFilenameChecks(): dict<list<string>>
htmlm4: ['file.html.m4'],
httest: ['file.htt', 'file.htb'],
hurl: ['file.hurl'],
+ hyprlang: ['hyprlock.conf', 'hyprland.conf', 'hypridle.conf', 'hyprpaper.conf'],
i3config: ['/home/user/.i3/config', '/home/user/.config/i3/config', '/etc/i3/config', '/etc/xdg/i3/config'],
ibasic: ['file.iba', 'file.ibi'],
icemenu: ['/.icewm/menu', 'any/.icewm/menu'],
@@ -344,6 +345,7 @@ def s:GetFilenameChecks(): dict<list<string>>
inform: ['file.inf', 'file.INF'],
initng: ['/etc/initng/any/file.i', 'file.ii', 'any/etc/initng/any/file.i'],
inittab: ['inittab'],
+ inko: ['file.inko'],
ipfilter: ['ipf.conf', 'ipf6.conf', 'ipf.rules'],
iss: ['file.iss'],
ist: ['file.ist', 'file.mst'],
@@ -358,10 +360,11 @@ def s:GetFilenameChecks(): dict<list<string>>
javascriptreact: ['file.jsx'],
jess: ['file.clp'],
jgraph: ['file.jgr'],
+ jj: ['file.jjdescription'],
jq: ['file.jq'],
jovial: ['file.jov', 'file.j73', 'file.jovial'],
jproperties: ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file', 'org.eclipse.xyz.prefs'],
- json: ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', '.prettierrc', '.firebaserc', '.stylelintrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace', 'file.bd', 'file.bda', 'file.xci', 'flake.lock'],
+ json: ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', '.prettierrc', '.firebaserc', '.stylelintrc', '.lintstagedrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace', 'file.bd', 'file.bda', 'file.xci', 'flake.lock'],
json5: ['file.json5'],
jsonc: ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.jscsrc', '.vsconfig', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc'],
jsonl: ['file.jsonl'],
@@ -417,7 +420,7 @@ def s:GetFilenameChecks(): dict<list<string>>
mail: ['snd.123', '.letter', '.letter.123', '.followup', '.article', '.article.123', 'pico.123', 'mutt-xx-xxx', 'muttng-xx-xxx', 'ae123.txt', 'file.eml', 'reportbug-file'],
mailaliases: ['/etc/mail/aliases', '/etc/aliases', 'any/etc/aliases', 'any/etc/mail/aliases'],
mailcap: ['.mailcap', 'mailcap'],
- make: ['file.mk', 'file.mak', 'file.dsp', 'makefile', 'Makefile', 'makefile-file', 'Makefile-file', 'some-makefile', 'some-Makefile'],
+ make: ['file.mk', 'file.mak', 'file.dsp', 'makefile', 'Makefile', 'makefile-file', 'Makefile-file', 'some-makefile', 'some-Makefile', 'Kbuild'],
mallard: ['file.page'],
man: ['file.man'],
manconf: ['/etc/man.conf', 'man.config', 'any/etc/man.conf'],
@@ -574,6 +577,7 @@ def s:GetFilenameChecks(): dict<list<string>>
psl: ['file.psl'],
pug: ['file.pug'],
puppet: ['file.pp'],
+ purescript: ['file.purs'],
pymanifest: ['MANIFEST.in'],
pyret: ['file.arr'],
pyrex: ['file.pyx', 'file.pxd'],
@@ -588,6 +592,7 @@ def s:GetFilenameChecks(): dict<list<string>>
radiance: ['file.rad', 'file.mat'],
raku: ['file.pm6', 'file.p6', 'file.t6', 'file.pod6', 'file.raku', 'file.rakumod', 'file.rakudoc', 'file.rakutest'],
raml: ['file.raml'],
+ rasi: ['file.rasi'],
ratpoison: ['.ratpoisonrc', 'ratpoisonrc'],
rbs: ['file.rbs'],
rc: ['file.rc', 'file.rch'],
@@ -640,7 +645,7 @@ def s:GetFilenameChecks(): dict<list<string>>
sh: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', '.bash-history',
'/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'APKBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh',
'/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile',
- 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf'],
+ 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf', 'file.mdd', 'file.cygport'],
sieve: ['file.siv', 'file.sieve'],
sil: ['file.sil'],
simula: ['file.sim'],
@@ -651,6 +656,7 @@ def s:GetFilenameChecks(): dict<list<string>>
slang: ['file.sl'],
sage: ['file.sage'],
slice: ['file.ice'],
+ slint: ['file.slint'],
slpconf: ['/etc/slp.conf', 'any/etc/slp.conf'],
slpreg: ['/etc/slp.reg', 'any/etc/slp.reg'],
slpspi: ['/etc/slp.spi', 'any/etc/slp.spi'],
@@ -663,6 +669,7 @@ def s:GetFilenameChecks(): dict<list<string>>
smith: ['file.smt', 'file.smith'],
smithy: ['file.smithy'],
sml: ['file.sml'],
+ snakemake: ['file.smk', 'Snakefile'],
snobol4: ['file.sno', 'file.spt'],
solidity: ['file.sol'],
solution: ['file.sln'],
@@ -686,6 +693,7 @@ def s:GetFilenameChecks(): dict<list<string>>
starlark: ['file.ipd', 'file.star', 'file.starlark'],
stata: ['file.ado', 'file.do', 'file.imata', 'file.mata'],
stp: ['file.stp'],
+ stylus: ['a.styl', 'file.stylus'],
sudoers: ['any/etc/sudoers', 'sudoers.tmp', '/etc/sudoers', 'any/etc/sudoers.d/file'],
supercollider: ['file.quark'],
surface: ['file.sface'],
@@ -746,11 +754,12 @@ def s:GetFilenameChecks(): dict<list<string>>
tcl: ['file.tcl', 'file.tm', 'file.tk', 'file.itcl', 'file.itk', 'file.jacl', '.tclshrc', 'tclsh.rc', '.wishrc', '.tclsh-history', '.xsctcmdhistory', '.xsdbcmdhistory'],
tablegen: ['file.td'],
teal: ['file.tl'],
+ templ: ['file.templ'],
template: ['file.tmpl'],
teraterm: ['file.ttl'],
terminfo: ['file.ti'],
'terraform-vars': ['file.tfvars'],
- tex: ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl', 'any/.texlive/texmf-config/tex/latex/file/file.cfg', 'file.pgf', 'file.nlo', 'file.nls', 'file.out', 'file.thm', 'file.eps_tex', 'file.pygtex', 'file.pygstyle', 'file.clo', 'file.aux', 'file.brf', 'file.ind', 'file.lof', 'file.loe', 'file.nav', 'file.vrb', 'file.ins', 'file.tikz', 'file.bbx', 'file.cbx', 'file.beamer'],
+ tex: ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl', 'any/.texlive/texmf-config/tex/latex/file/file.cfg', 'file.pgf', 'file.nlo', 'file.nls', 'file.thm', 'file.eps_tex', 'file.pygtex', 'file.pygstyle', 'file.clo', 'file.aux', 'file.brf', 'file.ind', 'file.lof', 'file.loe', 'file.nav', 'file.vrb', 'file.ins', 'file.tikz', 'file.bbx', 'file.cbx', 'file.beamer'],
texinfo: ['file.texinfo', 'file.texi', 'file.txi'],
texmf: ['texmf.cnf'],
text: ['file.text', 'file.txt', 'README', 'LICENSE', 'COPYING', 'AUTHORS', '/usr/share/doc/bash-completion/AUTHORS', '/etc/apt/apt.conf.d/README', '/etc/Muttrc.d/README'],
@@ -985,6 +994,7 @@ def s:GetScriptChecks(): dict<list<list<string>>>
['#!/path/regina']],
janet: [['#!/path/janet']],
dart: [['#!/path/dart']],
+ vim: [['#!/path/vim']],
}
enddef
@@ -1506,6 +1516,41 @@ func Test_git_file()
filetype off
endfunc
+func Test_haredoc_file()
+ filetype on
+ call assert_true(mkdir('foo/bar', 'pR'))
+
+ call writefile([], 'README', 'D')
+ split README
+ call assert_notequal('haredoc', &filetype)
+ bwipe!
+
+ let g:filetype_haredoc = 1
+ split README
+ call assert_notequal('haredoc', &filetype)
+ bwipe!
+
+ call writefile([], 'foo/quux.ha')
+ split README
+ call assert_equal('haredoc', &filetype)
+ bwipe!
+ call delete('foo/quux.ha')
+
+ call writefile([], 'foo/bar/baz.ha', 'D')
+ split README
+ call assert_notequal('haredoc', &filetype)
+ bwipe!
+
+ let g:haredoc_search_depth = 2
+ split README
+ call assert_equal('haredoc', &filetype)
+ bwipe!
+ unlet g:filetype_haredoc
+ unlet g:haredoc_search_depth
+
+ filetype off
+endfunc
+
func Test_hook_file()
filetype on
@@ -1684,14 +1729,14 @@ func Test_mod_file()
call assert_equal('pim', b:modula2.dialect)
bwipe!
- " Modula-2 program MODULE with priorty (and uppercase extension)
+ " Modula-2 program MODULE with priority (and uppercase extension)
call writefile(['MODULE Module2Mod [42];'], 'Xfile.MOD')
split Xfile.MOD
call assert_equal('modula2', &filetype)
call assert_equal('pim', b:modula2.dialect)
bwipe!
- " Modula-2 implementation MODULE with priorty (and uppercase extension)
+ " Modula-2 implementation MODULE with priority (and uppercase extension)
call writefile(['IMPLEMENTATION MODULE Module2Mod [42];'], 'Xfile.MOD')
split Xfile.MOD
call assert_equal('modula2', &filetype)