Skip to content

Commit 0af3ab2

Browse files
committed
updated for version 7.3.1223
Problem: Tests fail on MS-Windows. Solution: Avoid depending on OS version. Use DOS commands instead of Unix commands. (Taro Muraoka, Ken Takata)
1 parent 94587a5 commit 0af3ab2

File tree

5 files changed

+43
-16
lines changed

5 files changed

+43
-16
lines changed

src/testdir/test17.in

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ STARTTEST
99
:else
1010
: set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,}
1111
:endif
12+
:function! DeleteDirectory(dir)
13+
: if has("win16") || has("win32") || has("win64") || has("dos16") || has("dos32")
14+
: exec "silent !rmdir /Q /S " . a:dir
15+
: else
16+
: exec "silent !rm -rf " . a:dir
17+
: endif
18+
:endfun
1219
:if has("unix")
1320
:let $CDIR = "."
1421
/CDIR
@@ -20,6 +27,11 @@ STARTTEST
2027
:endif
2128
/TDIR
2229
:endif
30+
:" Dummy writing for making that sure gf doesn't fail even if the current
31+
:" file is modified. It can be occurred when executing the following command
32+
:" directly on Windows without fixing the 'fileformat':
33+
:" > nmake -f Make_dos.mak test17.out
34+
:w! test.out
2335
gf
2436
:w! test.out
2537
:brewind
@@ -31,10 +43,11 @@ ENDTEST
3143
STARTTEST
3244
:" check for 'include' without \zs or \ze
3345
:lang C
34-
:!rm -f ./Xbase.a
35-
:!rm -rf ./Xdir1
36-
:!mkdir -p Xdir1/dir2
37-
:e Xdir1/dir2/foo.a
46+
:call delete("./Xbase.a")
47+
:call DeleteDirectory("Xdir1")
48+
:!mkdir Xdir1
49+
:!mkdir "Xdir1/dir2"
50+
:e! Xdir1/dir2/foo.a
3851
i#include "bar.a"
3952
:w
4053
:e Xdir1/dir2/bar.a
@@ -55,15 +68,16 @@ ENDTEST
5568

5669
STARTTEST
5770
:" check for 'include' with \zs and \ze
58-
:!rm -f ./Xbase.b
59-
:!rm -rf ./Xdir1
60-
:!mkdir -p Xdir1/dir2
71+
:call delete("./Xbase.b")
72+
:call DeleteDirectory("Xdir1")
73+
:!mkdir Xdir1
74+
:!mkdir "Xdir1/dir2"
6175
:let &include='^\s*%inc\s*/\zs[^/]\+\ze'
6276
:function! DotsToSlashes()
6377
: return substitute(v:fname, '\.', '/', 'g') . '.b'
6478
:endfunction
6579
:let &includeexpr='DotsToSlashes()'
66-
:e Xdir1/dir2/foo.b
80+
:e! Xdir1/dir2/foo.b
6781
i%inc /bar/
6882
:w
6983
:e Xdir1/dir2/bar.b
@@ -84,9 +98,10 @@ ENDTEST
8498

8599
STARTTEST
86100
:" check for 'include' with \zs and no \ze
87-
:!rm -f ./Xbase.c
88-
:!rm -rf ./Xdir1
89-
:!mkdir -p Xdir1/dir2
101+
:call delete("./Xbase.c")
102+
:call DeleteDirectory("Xdir1")
103+
:!mkdir Xdir1
104+
:!mkdir "Xdir1/dir2"
90105
:let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze'
91106
:function! StripNewlineChar()
92107
: if v:fname =~ '\n$'
@@ -95,7 +110,7 @@ STARTTEST
95110
: return v:fname
96111
:endfunction
97112
:let &includeexpr='StripNewlineChar()'
98-
:e Xdir1/dir2/foo.c
113+
:e! Xdir1/dir2/foo.c
99114
i%inc bar.c
100115
:w
101116
:e Xdir1/dir2/bar.c
@@ -115,6 +130,10 @@ i%inc FALSE.c foo.c
115130
:checkpath!
116131
:redir END
117132
:brewind
133+
:" replace "\" to "/" for Windows
134+
:e test.out
135+
:%s#\\#/#g
136+
:w
118137
:q
119138
ENDTEST
120139

src/testdir/test50.in

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,26 @@ endfun
3333
" This could change for CygWin to //cygdrive/c
3434
let dir1='c:/x.x.y'
3535
if filereadable(dir1) || isdirectory(dir1)
36-
call confirm( "'".dir1."' exists, cannot run test" )
36+
echo "FATAL: '".dir1."' exists, cannot run test"
3737
return
3838
endif
3939
let file1=dir1.'/zz.y.txt'
4040
let nofile1=dir1.'/z.y.txt'
4141
let dir2=dir1.'/VimIsTheGreatestSinceSlicedBread'
4242
let file2=dir2.'/z.txt'
4343
let nofile2=dir2.'/zz.txt'
44-
let resdir1='c:/XX2235~1.Y'
44+
call MakeDir( dir1 )
45+
let resdir1 = substitute(fnamemodify(dir1, ':p:8'), '\\$', '', '')
46+
if resdir1 !~ '\V\^c:/XX\x\x\x\x~1.Y\$'
47+
echo "FATAL: unexpected short name: " . resdir1
48+
echo "INFO: please report your OS to vim-dev"
49+
return
50+
endif
4551
let resfile1=resdir1.'/ZZY~1.TXT'
4652
let resnofile1=resdir1.'/z.y.txt'
4753
let resdir2=resdir1.'/VIMIST~1'
4854
let resfile2=resdir2.'/z.txt'
4955
let resnofile2=resdir2.'/zz.txt'
50-
call MakeDir( dir1 )
5156
call MakeDir( dir2 )
5257
call MakeFile( file1 )
5358
call MakeFile( file2 )

src/testdir/test71.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ STARTTEST
88
:let cm0_bytes = getline('.', '.')
99
:/^start of cm=blowfish bytes/+1
1010
:let cm1_bytes = getline('.', '.')
11-
:bwipe
11+
:bwipe!
1212
:call append(0, text_lines)
1313
:$d
1414
:X

src/testdir/test77.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ggdd
2323
:w! Xtest
2424
:r !cksum Xtest
2525
:s/\s/ /g
26+
:set fileformat&
2627
:.w! test.out
2728
:qa!
2829
ENDTEST

src/version.c

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

729729
static int included_patches[] =
730730
{ /* Add new patch number below this line */
731+
/**/
732+
1223,
731733
/**/
732734
1222,
733735
/**/

0 commit comments

Comments
 (0)