comparison src/testdir/test_filetype.vim @ 12029:a39e7e2ae7da v8.0.0895

patch 8.0.0895: filetype test fails on MS-Windows commit https://github.com/vim/vim/commit/8ab3c1dc6bf70021f89e6e614b202606863bc168 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 9 22:24:52 2017 +0200 patch 8.0.0895: filetype test fails on MS-Windows Problem: Filetype test fails on MS-Windows. Solution: Fix file names.
author Christian Brabandt <cb@256bit.org>
date Wed, 09 Aug 2017 22:30:05 +0200
parents c2aa4af29251
children 7eb512f2a896
comparison
equal deleted inserted replaced
12028:b08ae659269c 12029:a39e7e2ae7da
76 \ 'bib': ['file.bib'], 76 \ 'bib': ['file.bib'],
77 \ 'bindzone': ['named.root'], 77 \ 'bindzone': ['named.root'],
78 \ 'blank': ['file.bl'], 78 \ 'blank': ['file.bl'],
79 \ 'bst': ['file.bst'], 79 \ 'bst': ['file.bst'],
80 \ 'bzr': ['bzr_log.any'], 80 \ 'bzr': ['bzr_log.any'],
81 \ 'c': ['*enlightenment/file.cfg', 'file.qc', 'file.c'], 81 \ 'c': ['enlightenment/file.cfg', 'file.qc', 'file.c'],
82 \ 'cabal': ['file.cabal'], 82 \ 'cabal': ['file.cabal'],
83 \ 'calendar': ['calendar'], 83 \ 'calendar': ['calendar'],
84 \ 'catalog': ['catalog'], 84 \ 'catalog': ['catalog'],
85 \ 'cdl': ['file.cdl'], 85 \ 'cdl': ['file.cdl'],
86 \ 'cdrdaoconf': ['/etc/cdrdao.conf', '/etc/defaults/cdrdao', '/etc/default/cdrdao', '.cdrdao'], 86 \ 'cdrdaoconf': ['/etc/cdrdao.conf', '/etc/defaults/cdrdao', '/etc/default/cdrdao', '.cdrdao'],
134 \ 'dnsmasq': ['/etc/dnsmasq.conf'], 134 \ 'dnsmasq': ['/etc/dnsmasq.conf'],
135 \ 'dockerfile': ['Dockerfile', 'file.Dockerfile'], 135 \ 'dockerfile': ['Dockerfile', 'file.Dockerfile'],
136 \ 'dosbatch': ['file.bat', 'file.sys'], 136 \ 'dosbatch': ['file.bat', 'file.sys'],
137 \ 'dosini': ['.editorconfig', '/etc/yum.conf', 'file.ini'], 137 \ 'dosini': ['.editorconfig', '/etc/yum.conf', 'file.ini'],
138 \ 'dot': ['file.dot'], 138 \ 'dot': ['file.dot'],
139 \ 'dracula': ['file.drac', 'file.drc', '*lvs', '*lpe'], 139 \ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe'],
140 \ 'dsl': ['file.dsl'], 140 \ 'dsl': ['file.dsl'],
141 \ 'dtd': ['file.dtd'], 141 \ 'dtd': ['file.dtd'],
142 \ 'dts': ['file.dts', 'file.dtsi'], 142 \ 'dts': ['file.dts', 'file.dtsi'],
143 \ 'dylan': ['file.dylan'], 143 \ 'dylan': ['file.dylan'],
144 \ 'dylanintr': ['file.intr'], 144 \ 'dylanintr': ['file.intr'],
147 \ 'edif': ['file.edf', 'file.edif', 'file.edo'], 147 \ 'edif': ['file.edf', 'file.edif', 'file.edo'],
148 \ 'elinks': ['/etc/elinks.conf', '/.elinks/elinks.conf'], 148 \ 'elinks': ['/etc/elinks.conf', '/.elinks/elinks.conf'],
149 \ 'elmfilt': ['filter-rules'], 149 \ 'elmfilt': ['filter-rules'],
150 \ 'erlang': ['file.erl', 'file.hrl', 'file.yaws'], 150 \ 'erlang': ['file.erl', 'file.hrl', 'file.yaws'],
151 \ 'eruby': ['file.erb', 'file.rhtml'], 151 \ 'eruby': ['file.erb', 'file.rhtml'],
152 \ 'esmtprc': ['*esmtprc'], 152 \ 'esmtprc': ['anyesmtprc'],
153 \ 'esqlc': ['file.ec', 'file.EC'], 153 \ 'esqlc': ['file.ec', 'file.EC'],
154 \ 'esterel': ['file.strl'], 154 \ 'esterel': ['file.strl'],
155 \ 'eterm': ['*Eterm/file.cfg'], 155 \ 'eterm': ['anyEterm/file.cfg'],
156 \ 'exim': ['exim.conf'], 156 \ 'exim': ['exim.conf'],
157 \ 'expect': ['file.exp'], 157 \ 'expect': ['file.exp'],
158 \ 'exports': ['exports'], 158 \ 'exports': ['exports'],
159 \ 'factor': ['file.factor'], 159 \ 'factor': ['file.factor'],
160 \ 'falcon': ['file.fal'], 160 \ 'falcon': ['file.fal'],
172 \ 'gedcom': ['file.ged', 'lltxxxxx.txt'], 172 \ 'gedcom': ['file.ged', 'lltxxxxx.txt'],
173 \ 'gitcommit': ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG'], 173 \ 'gitcommit': ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG'],
174 \ 'gitconfig': ['file.git/config', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config'], 174 \ 'gitconfig': ['file.git/config', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config'],
175 \ 'gitolite': ['gitolite.conf'], 175 \ 'gitolite': ['gitolite.conf'],
176 \ 'gitrebase': ['git-rebase-todo'], 176 \ 'gitrebase': ['git-rebase-todo'],
177 \ 'gitsendemail': ['.gitsendemail.msg.??????'], 177 \ 'gitsendemail': ['.gitsendemail.msg.xxxxxx'],
178 \ 'gkrellmrc': ['gkrellmrc', 'gkrellmrc_?'], 178 \ 'gkrellmrc': ['gkrellmrc', 'gkrellmrc_x'],
179 \ 'gnash': ['gnashrc', '.gnashrc', 'gnashpluginrc', '.gnashpluginrc'], 179 \ 'gnash': ['gnashrc', '.gnashrc', 'gnashpluginrc', '.gnashpluginrc'],
180 \ 'gnuplot': ['file.gpi'], 180 \ 'gnuplot': ['file.gpi'],
181 \ 'go': ['file.go'], 181 \ 'go': ['file.go'],
182 \ 'gp': ['file.gp', '.gprc'], 182 \ 'gp': ['file.gp', '.gprc'],
183 \ 'gpg': ['/.gnupg/options', '/.gnupg/gpg.conf', '/usr/*/gnupg/options.skel'], 183 \ 'gpg': ['/.gnupg/options', '/.gnupg/gpg.conf', '/usr/any/gnupg/options.skel'],
184 \ 'grads': ['file.gs'], 184 \ 'grads': ['file.gs'],
185 \ 'gretl': ['file.gretl'], 185 \ 'gretl': ['file.gretl'],
186 \ 'groovy': ['file.gradle', 'file.groovy'], 186 \ 'groovy': ['file.gradle', 'file.groovy'],
187 \ 'group': ['any/etc/group', 'any/etc/group-', 'any/etc/group.edit', 'any/etc/gshadow', 'any/etc/gshadow-', 'any/etc/gshadow.edit', 'any/var/backups/group.bak', 'any/var/backups/gshadow.bak'], 187 \ 'group': ['any/etc/group', 'any/etc/group-', 'any/etc/group.edit', 'any/etc/gshadow', 'any/etc/gshadow-', 'any/etc/gshadow.edit', 'any/var/backups/group.bak', 'any/var/backups/gshadow.bak'],
188 \ 'grub': ['/boot/grub/menu.lst', '/boot/grub/grub.conf', '/etc/grub.conf'], 188 \ 'grub': ['/boot/grub/menu.lst', '/boot/grub/grub.conf', '/etc/grub.conf'],
206 \ 'ibasic': ['file.iba', 'file.ibi'], 206 \ 'ibasic': ['file.iba', 'file.ibi'],
207 \ 'icemenu': ['/.icewm/menu'], 207 \ 'icemenu': ['/.icewm/menu'],
208 \ 'icon': ['file.icn'], 208 \ 'icon': ['file.icn'],
209 \ 'indent': ['.indent.pro', 'indentrc'], 209 \ 'indent': ['.indent.pro', 'indentrc'],
210 \ 'inform': ['file.inf', 'file.INF'], 210 \ 'inform': ['file.inf', 'file.INF'],
211 \ 'initng': ['/etc/initng/*/file.i', 'file.ii'], 211 \ 'initng': ['/etc/initng/any/file.i', 'file.ii'],
212 \ 'inittab': ['inittab'], 212 \ 'inittab': ['inittab'],
213 \ 'ipfilter': ['ipf.conf', 'ipf6.conf', 'ipf.rules'], 213 \ 'ipfilter': ['ipf.conf', 'ipf6.conf', 'ipf.rules'],
214 \ 'iss': ['file.iss'], 214 \ 'iss': ['file.iss'],
215 \ 'ist': ['file.ist', 'file.mst'], 215 \ 'ist': ['file.ist', 'file.mst'],
216 \ 'j': ['file.ijs'], 216 \ 'j': ['file.ijs'],
220 \ 'javacc': ['file.jj', 'file.jjt'], 220 \ 'javacc': ['file.jj', 'file.jjt'],
221 \ 'javascript': ['file.js', 'file.javascript', 'file.es', 'file.jsx', 'file.mjs'], 221 \ 'javascript': ['file.js', 'file.javascript', 'file.es', 'file.jsx', 'file.mjs'],
222 \ 'jess': ['file.clp'], 222 \ 'jess': ['file.clp'],
223 \ 'jgraph': ['file.jgr'], 223 \ 'jgraph': ['file.jgr'],
224 \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'], 224 \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'],
225 \ 'jproperties': ['file.properties', 'file.properties_??', 'file.properties_??_??'], 225 \ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx'],
226 \ 'json': ['file.json', 'file.jsonp', 'file.webmanifest'], 226 \ 'json': ['file.json', 'file.jsonp', 'file.webmanifest'],
227 \ 'jsp': ['file.jsp'], 227 \ 'jsp': ['file.jsp'],
228 \ 'kconfig': ['Kconfig', 'Kconfig.debug'], 228 \ 'kconfig': ['Kconfig', 'Kconfig.debug'],
229 \ 'kivy': ['file.kv'], 229 \ 'kivy': ['file.kv'],
230 \ 'kix': ['file.kix'], 230 \ 'kix': ['file.kix'],
234 \ 'latte': ['file.latte', 'file.lte'], 234 \ 'latte': ['file.latte', 'file.lte'],
235 \ 'ld': ['file.ld'], 235 \ 'ld': ['file.ld'],
236 \ 'ldif': ['file.ldif'], 236 \ 'ldif': ['file.ldif'],
237 \ 'less': ['file.less'], 237 \ 'less': ['file.less'],
238 \ 'lex': ['file.lex', 'file.l', 'file.lxx', 'file.l++'], 238 \ 'lex': ['file.lex', 'file.l', 'file.lxx', 'file.l++'],
239 \ 'lftp': ['lftp.conf', '.lftprc', '*lftp/rc'], 239 \ 'lftp': ['lftp.conf', '.lftprc', 'anylftp/rc'],
240 \ 'lhaskell': ['file.lhs'], 240 \ 'lhaskell': ['file.lhs'],
241 \ 'libao': ['/etc/libao.conf', '/.libao'], 241 \ 'libao': ['/etc/libao.conf', '/.libao'],
242 \ 'lifelines': ['file.ll'], 242 \ 'lifelines': ['file.ll'],
243 \ 'lilo': ['lilo.conf'], 243 \ 'lilo': ['lilo.conf'],
244 \ 'limits': ['/etc/limits', '/etc/*limits.conf', '/etc/*limits.d/file.conf'], 244 \ 'limits': ['/etc/limits', '/etc/anylimits.conf', '/etc/anylimits.d/file.conf'],
245 \ 'liquid': ['file.liquid'], 245 \ 'liquid': ['file.liquid'],
246 \ 'lisp': ['sbclrc', '.sbclrc'], 246 \ 'lisp': ['sbclrc', '.sbclrc'],
247 \ 'lite': ['file.lite', 'file.lt'], 247 \ 'lite': ['file.lite', 'file.lt'],
248 \ 'litestep': ['/LiteStep/*/file.rc'], 248 \ 'litestep': ['/LiteStep/any/file.rc'],
249 \ 'loginaccess': ['/etc/login.access'], 249 \ 'loginaccess': ['/etc/login.access'],
250 \ 'logindefs': ['/etc/login.defs'], 250 \ 'logindefs': ['/etc/login.defs'],
251 \ 'logtalk': ['file.lgt'], 251 \ 'logtalk': ['file.lgt'],
252 \ 'lotos': ['file.lot', 'file.lotos'], 252 \ 'lotos': ['file.lot', 'file.lotos'],
253 \ 'lout': ['file.lou', 'file.lout'], 253 \ 'lout': ['file.lou', 'file.lout'],
283 \ 'mib': ['file.mib', 'file.my'], 283 \ 'mib': ['file.mib', 'file.my'],
284 \ 'mix': ['file.mix', 'file.mixal'], 284 \ 'mix': ['file.mix', 'file.mixal'],
285 \ 'mma': ['file.nb'], 285 \ 'mma': ['file.nb'],
286 \ 'mmp': ['file.mmp'], 286 \ 'mmp': ['file.mmp'],
287 \ 'modconf': ['/etc/modules.conf', '/etc/modules', '/etc/conf.modules'], 287 \ 'modconf': ['/etc/modules.conf', '/etc/modules', '/etc/conf.modules'],
288 \ 'modula2': ['file.m2', 'file.DEF', 'file.MOD', 'file.mi'], 288 \ 'modula2': ['file.m2', 'file.mi'],
289 \ 'monk': ['file.isc', 'file.monk', 'file.ssc', 'file.tsc'], 289 \ 'monk': ['file.isc', 'file.monk', 'file.ssc', 'file.tsc'],
290 \ 'moo': ['file.moo'], 290 \ 'moo': ['file.moo'],
291 \ 'mp': ['file.mp'], 291 \ 'mp': ['file.mp'],
292 \ 'mplayerconf': ['mplayer.conf', '/.mplayer/config'], 292 \ 'mplayerconf': ['mplayer.conf', '/.mplayer/config'],
293 \ 'mrxvtrc': ['mrxvtrc', '.mrxvtrc'], 293 \ 'mrxvtrc': ['mrxvtrc', '.mrxvtrc'],
499 \ 'aap': ['file.aap'], 499 \ 'aap': ['file.aap'],
500 \ 'help': [$VIMRUNTIME . '/doc/help.txt'], 500 \ 'help': [$VIMRUNTIME . '/doc/help.txt'],
501 \ 'xpm': ['file.xpm'], 501 \ 'xpm': ['file.xpm'],
502 \ } 502 \ }
503 503
504 func Test_filetype_detection() 504 let s:filename_case_checks = {
505 filetype on 505 \ 'modula2': ['file.DEF', 'file.MOD'],
506 for [ft, names] in items(s:filename_checks) 506 \ }
507
508 func CheckItems(checks)
509 for [ft, names] in items(a:checks)
507 for i in range(0, len(names) - 1) 510 for i in range(0, len(names) - 1)
508 new 511 new
509 try 512 try
510 exe 'edit ' . names[i] 513 exe 'edit ' . names[i]
511 catch 514 catch
514 call assert_equal(ft, &filetype, 'with file name: ' . names[i]) 517 call assert_equal(ft, &filetype, 'with file name: ' . names[i])
515 bwipe! 518 bwipe!
516 endfor 519 endfor
517 endfor 520 endfor
518 endfunc 521 endfunc
522
523 func Test_filetype_detection()
524 filetype on
525 call CheckItems(s:filename_checks)
526 if has('fname_case')
527 call CheckItems(s:filename_case_checks)
528 endif
529 endfunc