Skip to content

Commit 8ab3c1d

Browse files
committed
patch 8.0.0895: filetype test fails on MS-Windows
Problem: Filetype test fails on MS-Windows. Solution: Fix file names.
1 parent 0a0217a commit 8ab3c1d

2 files changed

Lines changed: 29 additions & 16 deletions

File tree

src/testdir/test_filetype.vim

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ let s:filename_checks = {
7878
\ 'blank': ['file.bl'],
7979
\ 'bst': ['file.bst'],
8080
\ 'bzr': ['bzr_log.any'],
81-
\ 'c': ['*enlightenment/file.cfg', 'file.qc', 'file.c'],
81+
\ 'c': ['enlightenment/file.cfg', 'file.qc', 'file.c'],
8282
\ 'cabal': ['file.cabal'],
8383
\ 'calendar': ['calendar'],
8484
\ 'catalog': ['catalog'],
@@ -136,7 +136,7 @@ let s:filename_checks = {
136136
\ 'dosbatch': ['file.bat', 'file.sys'],
137137
\ 'dosini': ['.editorconfig', '/etc/yum.conf', 'file.ini'],
138138
\ 'dot': ['file.dot'],
139-
\ 'dracula': ['file.drac', 'file.drc', '*lvs', '*lpe'],
139+
\ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe'],
140140
\ 'dsl': ['file.dsl'],
141141
\ 'dtd': ['file.dtd'],
142142
\ 'dts': ['file.dts', 'file.dtsi'],
@@ -149,10 +149,10 @@ let s:filename_checks = {
149149
\ 'elmfilt': ['filter-rules'],
150150
\ 'erlang': ['file.erl', 'file.hrl', 'file.yaws'],
151151
\ 'eruby': ['file.erb', 'file.rhtml'],
152-
\ 'esmtprc': ['*esmtprc'],
152+
\ 'esmtprc': ['anyesmtprc'],
153153
\ 'esqlc': ['file.ec', 'file.EC'],
154154
\ 'esterel': ['file.strl'],
155-
\ 'eterm': ['*Eterm/file.cfg'],
155+
\ 'eterm': ['anyEterm/file.cfg'],
156156
\ 'exim': ['exim.conf'],
157157
\ 'expect': ['file.exp'],
158158
\ 'exports': ['exports'],
@@ -174,13 +174,13 @@ let s:filename_checks = {
174174
\ 'gitconfig': ['file.git/config', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config'],
175175
\ 'gitolite': ['gitolite.conf'],
176176
\ 'gitrebase': ['git-rebase-todo'],
177-
\ 'gitsendemail': ['.gitsendemail.msg.??????'],
178-
\ 'gkrellmrc': ['gkrellmrc', 'gkrellmrc_?'],
177+
\ 'gitsendemail': ['.gitsendemail.msg.xxxxxx'],
178+
\ 'gkrellmrc': ['gkrellmrc', 'gkrellmrc_x'],
179179
\ 'gnash': ['gnashrc', '.gnashrc', 'gnashpluginrc', '.gnashpluginrc'],
180180
\ 'gnuplot': ['file.gpi'],
181181
\ 'go': ['file.go'],
182182
\ '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'],
184184
\ 'grads': ['file.gs'],
185185
\ 'gretl': ['file.gretl'],
186186
\ 'groovy': ['file.gradle', 'file.groovy'],
@@ -208,7 +208,7 @@ let s:filename_checks = {
208208
\ 'icon': ['file.icn'],
209209
\ 'indent': ['.indent.pro', 'indentrc'],
210210
\ 'inform': ['file.inf', 'file.INF'],
211-
\ 'initng': ['/etc/initng/*/file.i', 'file.ii'],
211+
\ 'initng': ['/etc/initng/any/file.i', 'file.ii'],
212212
\ 'inittab': ['inittab'],
213213
\ 'ipfilter': ['ipf.conf', 'ipf6.conf', 'ipf.rules'],
214214
\ 'iss': ['file.iss'],
@@ -222,7 +222,7 @@ let s:filename_checks = {
222222
\ 'jess': ['file.clp'],
223223
\ 'jgraph': ['file.jgr'],
224224
\ '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'],
226226
\ 'json': ['file.json', 'file.jsonp', 'file.webmanifest'],
227227
\ 'jsp': ['file.jsp'],
228228
\ 'kconfig': ['Kconfig', 'Kconfig.debug'],
@@ -236,16 +236,16 @@ let s:filename_checks = {
236236
\ 'ldif': ['file.ldif'],
237237
\ 'less': ['file.less'],
238238
\ 'lex': ['file.lex', 'file.l', 'file.lxx', 'file.l++'],
239-
\ 'lftp': ['lftp.conf', '.lftprc', '*lftp/rc'],
239+
\ 'lftp': ['lftp.conf', '.lftprc', 'anylftp/rc'],
240240
\ 'lhaskell': ['file.lhs'],
241241
\ 'libao': ['/etc/libao.conf', '/.libao'],
242242
\ 'lifelines': ['file.ll'],
243243
\ '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'],
245245
\ 'liquid': ['file.liquid'],
246246
\ 'lisp': ['sbclrc', '.sbclrc'],
247247
\ 'lite': ['file.lite', 'file.lt'],
248-
\ 'litestep': ['/LiteStep/*/file.rc'],
248+
\ 'litestep': ['/LiteStep/any/file.rc'],
249249
\ 'loginaccess': ['/etc/login.access'],
250250
\ 'logindefs': ['/etc/login.defs'],
251251
\ 'logtalk': ['file.lgt'],
@@ -285,7 +285,7 @@ let s:filename_checks = {
285285
\ 'mma': ['file.nb'],
286286
\ 'mmp': ['file.mmp'],
287287
\ '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'],
289289
\ 'monk': ['file.isc', 'file.monk', 'file.ssc', 'file.tsc'],
290290
\ 'moo': ['file.moo'],
291291
\ 'mp': ['file.mp'],
@@ -501,9 +501,12 @@ let s:filename_checks = {
501501
\ 'xpm': ['file.xpm'],
502502
\ }
503503

504-
func Test_filetype_detection()
505-
filetype on
506-
for [ft, names] in items(s:filename_checks)
504+
let s:filename_case_checks = {
505+
\ 'modula2': ['file.DEF', 'file.MOD'],
506+
\ }
507+
508+
func CheckItems(checks)
509+
for [ft, names] in items(a:checks)
507510
for i in range(0, len(names) - 1)
508511
new
509512
try
@@ -516,3 +519,11 @@ func Test_filetype_detection()
516519
endfor
517520
endfor
518521
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

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
895,
772774
/**/
773775
894,
774776
/**/

0 commit comments

Comments
 (0)