0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

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)
This commit is contained in:
Bram Moolenaar 2013-06-19 21:17:31 +02:00
parent 22f93c700f
commit d73895ec00
5 changed files with 43 additions and 16 deletions

View File

@ -9,6 +9,13 @@ STARTTEST
:else :else
: set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,} : set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,}
:endif :endif
:function! DeleteDirectory(dir)
: if has("win16") || has("win32") || has("win64") || has("dos16") || has("dos32")
: exec "silent !rmdir /Q /S " . a:dir
: else
: exec "silent !rm -rf " . a:dir
: endif
:endfun
:if has("unix") :if has("unix")
:let $CDIR = "." :let $CDIR = "."
/CDIR /CDIR
@ -20,6 +27,11 @@ STARTTEST
:endif :endif
/TDIR /TDIR
:endif :endif
:" Dummy writing for making that sure gf doesn't fail even if the current
:" file is modified. It can be occurred when executing the following command
:" directly on Windows without fixing the 'fileformat':
:" > nmake -f Make_dos.mak test17.out
:w! test.out
gf gf
:w! test.out :w! test.out
:brewind :brewind
@ -31,10 +43,11 @@ ENDTEST
STARTTEST STARTTEST
:" check for 'include' without \zs or \ze :" check for 'include' without \zs or \ze
:lang C :lang C
:!rm -f ./Xbase.a :call delete("./Xbase.a")
:!rm -rf ./Xdir1 :call DeleteDirectory("Xdir1")
:!mkdir -p Xdir1/dir2 :!mkdir Xdir1
:e Xdir1/dir2/foo.a :!mkdir "Xdir1/dir2"
:e! Xdir1/dir2/foo.a
i#include "bar.a" i#include "bar.a"
:w :w
:e Xdir1/dir2/bar.a :e Xdir1/dir2/bar.a
@ -55,15 +68,16 @@ ENDTEST
STARTTEST STARTTEST
:" check for 'include' with \zs and \ze :" check for 'include' with \zs and \ze
:!rm -f ./Xbase.b :call delete("./Xbase.b")
:!rm -rf ./Xdir1 :call DeleteDirectory("Xdir1")
:!mkdir -p Xdir1/dir2 :!mkdir Xdir1
:!mkdir "Xdir1/dir2"
:let &include='^\s*%inc\s*/\zs[^/]\+\ze' :let &include='^\s*%inc\s*/\zs[^/]\+\ze'
:function! DotsToSlashes() :function! DotsToSlashes()
: return substitute(v:fname, '\.', '/', 'g') . '.b' : return substitute(v:fname, '\.', '/', 'g') . '.b'
:endfunction :endfunction
:let &includeexpr='DotsToSlashes()' :let &includeexpr='DotsToSlashes()'
:e Xdir1/dir2/foo.b :e! Xdir1/dir2/foo.b
i%inc /bar/ i%inc /bar/
:w :w
:e Xdir1/dir2/bar.b :e Xdir1/dir2/bar.b
@ -84,9 +98,10 @@ ENDTEST
STARTTEST STARTTEST
:" check for 'include' with \zs and no \ze :" check for 'include' with \zs and no \ze
:!rm -f ./Xbase.c :call delete("./Xbase.c")
:!rm -rf ./Xdir1 :call DeleteDirectory("Xdir1")
:!mkdir -p Xdir1/dir2 :!mkdir Xdir1
:!mkdir "Xdir1/dir2"
:let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze' :let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze'
:function! StripNewlineChar() :function! StripNewlineChar()
: if v:fname =~ '\n$' : if v:fname =~ '\n$'
@ -95,7 +110,7 @@ STARTTEST
: return v:fname : return v:fname
:endfunction :endfunction
:let &includeexpr='StripNewlineChar()' :let &includeexpr='StripNewlineChar()'
:e Xdir1/dir2/foo.c :e! Xdir1/dir2/foo.c
i%inc bar.c i%inc bar.c
:w :w
:e Xdir1/dir2/bar.c :e Xdir1/dir2/bar.c
@ -115,6 +130,10 @@ i%inc FALSE.c foo.c
:checkpath! :checkpath!
:redir END :redir END
:brewind :brewind
:" replace "\" to "/" for Windows
:e test.out
:%s#\\#/#g
:w
:q :q
ENDTEST ENDTEST

View File

@ -33,7 +33,7 @@ endfun
" This could change for CygWin to //cygdrive/c " This could change for CygWin to //cygdrive/c
let dir1='c:/x.x.y' let dir1='c:/x.x.y'
if filereadable(dir1) || isdirectory(dir1) if filereadable(dir1) || isdirectory(dir1)
call confirm( "'".dir1."' exists, cannot run test" ) echo "FATAL: '".dir1."' exists, cannot run test"
return return
endif endif
let file1=dir1.'/zz.y.txt' let file1=dir1.'/zz.y.txt'
@ -41,13 +41,18 @@ endfun
let dir2=dir1.'/VimIsTheGreatestSinceSlicedBread' let dir2=dir1.'/VimIsTheGreatestSinceSlicedBread'
let file2=dir2.'/z.txt' let file2=dir2.'/z.txt'
let nofile2=dir2.'/zz.txt' let nofile2=dir2.'/zz.txt'
let resdir1='c:/XX2235~1.Y' call MakeDir( dir1 )
let resdir1 = substitute(fnamemodify(dir1, ':p:8'), '\\$', '', '')
if resdir1 !~ '\V\^c:/XX\x\x\x\x~1.Y\$'
echo "FATAL: unexpected short name: " . resdir1
echo "INFO: please report your OS to vim-dev"
return
endif
let resfile1=resdir1.'/ZZY~1.TXT' let resfile1=resdir1.'/ZZY~1.TXT'
let resnofile1=resdir1.'/z.y.txt' let resnofile1=resdir1.'/z.y.txt'
let resdir2=resdir1.'/VIMIST~1' let resdir2=resdir1.'/VIMIST~1'
let resfile2=resdir2.'/z.txt' let resfile2=resdir2.'/z.txt'
let resnofile2=resdir2.'/zz.txt' let resnofile2=resdir2.'/zz.txt'
call MakeDir( dir1 )
call MakeDir( dir2 ) call MakeDir( dir2 )
call MakeFile( file1 ) call MakeFile( file1 )
call MakeFile( file2 ) call MakeFile( file2 )

View File

@ -8,7 +8,7 @@ STARTTEST
:let cm0_bytes = getline('.', '.') :let cm0_bytes = getline('.', '.')
:/^start of cm=blowfish bytes/+1 :/^start of cm=blowfish bytes/+1
:let cm1_bytes = getline('.', '.') :let cm1_bytes = getline('.', '.')
:bwipe :bwipe!
:call append(0, text_lines) :call append(0, text_lines)
:$d :$d
:X :X

View File

@ -23,6 +23,7 @@ ggdd
:w! Xtest :w! Xtest
:r !cksum Xtest :r !cksum Xtest
:s/\s/ /g :s/\s/ /g
:set fileformat&
:.w! test.out :.w! test.out
:qa! :qa!
ENDTEST ENDTEST

View File

@ -728,6 +728,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1223,
/**/ /**/
1222, 1222,
/**/ /**/