mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 13:03:39 +00:00
cmd/tests: Tweak subsection headers so they are treated as resynchronization points.
This commit is contained in:
parent
128d0656de
commit
87a770fa73
|
@ -89,7 +89,7 @@ rem@tab@echo foo & echo bar
|
|||
|
||||
echo ------------ Testing redirection operators ------------
|
||||
mkdir foobar & cd foobar
|
||||
echo ...stdout redirection
|
||||
echo --- stdout redirection
|
||||
echo foo>foo
|
||||
type foo
|
||||
echo foo 1> foo
|
||||
|
@ -113,7 +113,7 @@ type foo
|
|||
del foo
|
||||
echo1>foo
|
||||
type foo
|
||||
echo ...stdout appending
|
||||
echo --- stdout appending
|
||||
echo foo>foo
|
||||
echo foo >>foo
|
||||
type foo
|
||||
|
@ -133,7 +133,7 @@ del foo
|
|||
echo foo> foo
|
||||
echo foo7 7>> foo || (echo not supported & del foo)
|
||||
if exist foo (type foo) else echo not supported
|
||||
echo ...redirections within IF statements
|
||||
echo --- redirections within IF statements
|
||||
if 1==1 echo foo1>bar
|
||||
type bar & del bar
|
||||
if 1==1 (echo foo2>bar) else echo baz2>bar
|
||||
|
@ -286,7 +286,7 @@ echo %VAR:~-3,-2%
|
|||
set VAR=
|
||||
|
||||
echo ------------ Testing variable substitution ------------
|
||||
echo ...in FOR variables
|
||||
echo --- in FOR variables
|
||||
for %%i in ("A B" C) do echo %%i
|
||||
rem quotes removal
|
||||
for %%i in ("A B" C) do echo '%%~i'
|
||||
|
@ -319,7 +319,7 @@ for %%i in ("g h" i) do echo %%~sdi
|
|||
for %%i in ("g h" i) do echo %%~dsi
|
||||
for %%i in ("j k" l.eh) do echo '%%~xsi'
|
||||
|
||||
echo ...in parameters
|
||||
echo --- in parameters
|
||||
for %%i in ("A B" C) do call :echoFun %%i
|
||||
rem quotes removal
|
||||
for %%i in ("A B" C) do call :echoFunQ %%i
|
||||
|
@ -397,7 +397,7 @@ goto :eof
|
|||
|
||||
echo ------------ Testing variable delayed expansion ------------
|
||||
rem NT4 doesn't support this
|
||||
echo ...default mode (load-time expansion)
|
||||
echo --- default mode (load-time expansion)
|
||||
set FOO=foo
|
||||
echo %FOO%
|
||||
echo !FOO!
|
||||
|
@ -412,7 +412,7 @@ if %FOO% == foo (
|
|||
if !FOO! == bar (echo bar) else echo foo
|
||||
)
|
||||
|
||||
echo ...runtime (delayed) expansion mode
|
||||
echo --- runtime (delayed) expansion mode
|
||||
setlocal EnableDelayedExpansion
|
||||
set FOO=foo
|
||||
echo %FOO%
|
||||
|
@ -434,7 +434,7 @@ set FOO=foo
|
|||
echo %FOO%
|
||||
echo !FOO!
|
||||
set FOO=
|
||||
echo ...using /V cmd flag
|
||||
echo --- using /V cmd flag
|
||||
echo @echo off> tmp.cmd
|
||||
echo set FOO=foo>> tmp.cmd
|
||||
echo echo %%FOO%%>> tmp.cmd
|
||||
|
@ -445,7 +445,7 @@ cmd /V:OfF /C tmp.cmd
|
|||
del tmp.cmd
|
||||
|
||||
echo ------------ Testing conditional execution ------------
|
||||
echo ...unconditional ^&
|
||||
echo --- unconditional ampersand
|
||||
call :setError 123 & echo foo1
|
||||
echo bar2 & echo foo2
|
||||
mkdir foobar & cd foobar
|
||||
|
@ -456,14 +456,14 @@ if exist foobazbar (
|
|||
cd ..
|
||||
rd /s/q foobar
|
||||
) else echo foobar deleted
|
||||
echo ...on success conditional ^&^&
|
||||
echo --- on success conditional and
|
||||
call :setError 456 && echo foo3 > foo3
|
||||
if exist foo3 (
|
||||
echo foo3 created
|
||||
del foo3
|
||||
) else echo foo3 not created
|
||||
echo bar4 && echo foo4
|
||||
echo ...on failure conditional ^|^|
|
||||
echo --- on failure conditional or
|
||||
call :setError 789 || echo foo5
|
||||
echo foo6 || echo bar6 > bar6
|
||||
if exist bar6 (
|
||||
|
@ -518,10 +518,10 @@ echo ------------ Testing type ------------
|
|||
echo bar> foobaz
|
||||
@echo on
|
||||
type foobaz
|
||||
echo ***
|
||||
echo ---
|
||||
@echo off
|
||||
type foobaz@tab@
|
||||
echo ***
|
||||
echo ---
|
||||
del foobaz
|
||||
|
||||
echo ------------ Testing NUL ------------
|
||||
|
@ -593,7 +593,7 @@ if 1==0 (echo doom)@tab@else echo quake
|
|||
if 1==0 (echo doom) else@tab@echo quake
|
||||
|
||||
echo ------------ Testing for ------------
|
||||
echo ...plain FOR
|
||||
echo --- plain FOR
|
||||
for %%i in (A B C) do echo %%i
|
||||
for %%i in (A B C) do echo %%I
|
||||
for %%i in (A B C) do echo %%j
|
||||
|
@ -616,7 +616,7 @@ goto :endForTestFun1
|
|||
echo %1
|
||||
goto :eof
|
||||
:endForTestFun1
|
||||
echo ...imbricated FORs
|
||||
echo --- imbricated FORs
|
||||
for %%i in (X) do (
|
||||
for %%j in (Y) do (
|
||||
echo %%i %%j))
|
||||
|
@ -639,9 +639,9 @@ mkdir foo
|
|||
mkdir bar
|
||||
mkdir baz
|
||||
echo > bazbaz
|
||||
echo ...basic wildcards
|
||||
echo --- basic wildcards
|
||||
for %%i in (ba*) do echo %%i
|
||||
echo ...for /d
|
||||
echo --- for /d
|
||||
for /d %%i in (baz foo bar) do echo %%i
|
||||
rem FIXME for /d incorrectly parses when wildcards are used
|
||||
rem for /d %%i in (bazb*) do echo %%i
|
||||
|
@ -658,7 +658,7 @@ rem for /d %%i in (*) do echo %%i>> tmp
|
|||
rem sort < tmp
|
||||
rem del tmp
|
||||
cd .. & rd /s/Q foobar
|
||||
echo ...for /L
|
||||
echo --- for /L
|
||||
rem Some cases loop forever writing 0s, like e.g. (1,0,1), (1,a,3) or (a,b,c); those can't be tested here
|
||||
for /L %%i in (1,2,0) do echo %%i
|
||||
for@tab@/L %%i in (1,2,0) do echo %%i
|
||||
|
@ -678,10 +678,10 @@ rem for /L %%i in (1,1,1) do echo %%i
|
|||
rem for /L %%i in (1,-2,-1) do echo %%i
|
||||
rem for /L %%i in (-1,-1,-1) do echo %%i
|
||||
rem for /L %%i in (1,2, 3) do echo %%i
|
||||
echo ...for /a
|
||||
echo --- for /a
|
||||
rem No output when using "set expr" syntax, unless in interactive mode
|
||||
rem Need to use "set envvar=expr" to use in a batch script
|
||||
echo ......individual operations
|
||||
echo ------ individual operations
|
||||
set var=0
|
||||
set /a var=1 +2 & echo %var%
|
||||
set /a var=1 +-2 & echo %var%
|
||||
|
@ -721,7 +721,7 @@ set /a var=5 ^^ 1 & echo %var%
|
|||
set /a var=5 ^^ 3 & echo %var%
|
||||
set /a var=5 ^^ 4 & echo %var%
|
||||
set /a var=5 ^^ 1 & echo %var%
|
||||
echo ......precedence and grouping
|
||||
echo ------ precedence and grouping
|
||||
set /a var=4 + 2*3 & echo %var%
|
||||
set /a var=(4+2)*3 & echo %var%
|
||||
set /a var=4 * 3/5 & echo %var%
|
||||
|
@ -730,12 +730,12 @@ set /a var=4 * 5 %% 4 & echo %var%
|
|||
set /a var=4 * (5 %% 4) & echo %var%
|
||||
set /a var=3 %% (5 + 8 %% 3 ^^ 2) & echo %var%
|
||||
set /a var=3 %% (5 + 8 %% 3 ^^ -2) & echo %var%
|
||||
echo ......octal and hexadecimal
|
||||
echo ------ octal and hexadecimal
|
||||
set /a var=0xf + 3 & echo %var%
|
||||
set /a var=0xF + 3 & echo %var%
|
||||
set /a var=015 + 2 & echo %var%
|
||||
set /a var=3, 8+3,0 & echo %var%
|
||||
echo ......variables
|
||||
echo ------ variables
|
||||
set /a var=foo=3, foo+1 & echo %var%
|
||||
if defined foo (echo %foo%) else (
|
||||
echo foo not defined
|
||||
|
@ -757,16 +757,16 @@ set /a var=foo=19, foo %%= 4 + (bar %%= 7) & echo.
|
|||
set foo=
|
||||
set bar=
|
||||
set var=
|
||||
echo ...for /F
|
||||
echo --- for /F
|
||||
mkdir foobar & cd foobar
|
||||
echo ......string argument
|
||||
echo ------ string argument
|
||||
for /F %%i in ("a b c") do echo %%i
|
||||
for /f %%i in ("a ") do echo %%i
|
||||
for /f %%i in ("a") do echo %%i
|
||||
fOr /f %%i in (" a") do echo %%i
|
||||
for /f %%i in (" a ") do echo %%i
|
||||
echo ......fileset argument
|
||||
echo .........basic blank handling
|
||||
echo ------ fileset argument
|
||||
echo --------- basic blank handling
|
||||
echo a b c>foo
|
||||
for /f %%i in (foo) do echo %%i
|
||||
echo a >foo
|
||||
|
@ -782,7 +782,7 @@ for /f %%i in (foo) do echo %%i
|
|||
echo. >> foo
|
||||
echo b > foo
|
||||
for /f %%i in (foo) do echo %%i
|
||||
echo .........multi-line with empty lines
|
||||
echo --------- multi-line with empty lines
|
||||
echo a Z f> foo
|
||||
echo. >> foo
|
||||
echo.>> foo
|
||||
|
@ -790,20 +790,20 @@ echo b bC>> foo
|
|||
echo c>> foo
|
||||
echo. >> foo
|
||||
for /f %%b in (foo) do echo %%b
|
||||
echo .........multiple files
|
||||
echo --------- multiple files
|
||||
echo q w > bar
|
||||
echo.>> bar
|
||||
echo kkk>>bar
|
||||
for /f %%k in (foo bar) do echo %%k
|
||||
for /f %%k in (bar foo) do echo %%k
|
||||
rem echo ......command argument
|
||||
rem echo ------ command argument
|
||||
rem Not implemented on NT4
|
||||
rem FIXME: Not testable right now in wine: not implemented and would need
|
||||
rem preliminary grep-like program implementation (e.g. like findstr or fc) even
|
||||
rem for a simple todo_wine test
|
||||
rem (for /f "usebackq" %%i in (`echo z a b`) do echo %%i) || echo not supported
|
||||
rem (for /f usebackq %%i in (`echo z a b`) do echo %%i) || echo not supported
|
||||
echo ......eol option
|
||||
echo ------ eol option
|
||||
for /f "eol=@" %%i in (" ad") do echo %%i
|
||||
for /f "eol=@" %%i in (" z@y") do echo %%i
|
||||
for /f "eol=|" %%i in ("a|d") do echo %%i
|
||||
|
@ -811,7 +811,7 @@ for /f "eol=@" %%i in ("@y") do echo %%i > output_file
|
|||
if not exist output_file (echo no output) else (del output_file)
|
||||
for /f "eol==" %%i in ("=y") do echo %%i > output_file
|
||||
if not exist output_file (echo no output) else (del output_file)
|
||||
echo ......delims option
|
||||
echo ------ delims option
|
||||
for /f "delims=|" %%i in ("a|d") do echo %%i
|
||||
for /f "delims=|" %%i in ("a |d") do echo %%i
|
||||
for /f "delims=|" %%i in ("a d|") do echo %%i
|
||||
|
@ -819,7 +819,7 @@ for /f "delims=| " %%i in ("a d|") do echo %%i
|
|||
for /f "delims==" %%i in ("C r=d|") do echo %%i
|
||||
for /f "delims=" %%i in ("foo bar baz") do echo %%i
|
||||
for /f "delims=" %%i in ("c:\foo bar baz\..") do echo %%~fi
|
||||
echo ......skip option
|
||||
echo ------ skip option
|
||||
echo a > foo
|
||||
echo b >> foo
|
||||
echo c >> foo
|
||||
|
@ -883,7 +883,7 @@ rmdir "foo bar"
|
|||
|
||||
echo ------------ Testing rename ------------
|
||||
mkdir foobar & cd foobar
|
||||
echo ... ren and rename are synonymous ...
|
||||
echo --- ren and rename are synonymous
|
||||
echo > foo
|
||||
rename foo bar
|
||||
if exist foo echo foo should be renamed!
|
||||
|
@ -891,7 +891,7 @@ if exist bar echo foo renamed to bar
|
|||
ren bar foo
|
||||
if exist bar echo bar should be renamed!
|
||||
if exist foo echo bar renamed to foo
|
||||
echo ... name collision ...
|
||||
echo --- name collision
|
||||
echo foo>foo
|
||||
echo bar>bar
|
||||
ren foo bar 2> nul
|
||||
|
@ -901,7 +901,7 @@ rem no-op
|
|||
ren foo foo
|
||||
mkdir baz
|
||||
ren foo baz\abc
|
||||
echo ... rename read-only files ...
|
||||
echo --- rename read-only files
|
||||
echo > file1
|
||||
attrib +r file1
|
||||
ren file1 file2
|
||||
|
@ -912,7 +912,7 @@ if not exist file1 (
|
|||
) else (
|
||||
echo read-only file not renamed!
|
||||
)
|
||||
echo ... rename directories ...
|
||||
echo --- rename directories
|
||||
mkdir rep1
|
||||
ren rep1 rep2
|
||||
if not exist rep1 (
|
||||
|
@ -927,7 +927,7 @@ if not exist rep2 (
|
|||
echo read-only dir renamed
|
||||
)
|
||||
)
|
||||
echo ... rename in other directory ...
|
||||
echo --- rename in other directory
|
||||
if not exist baz\abc (
|
||||
echo rename impossible in other directory
|
||||
if exist foo echo original file still present
|
||||
|
@ -939,7 +939,7 @@ cd .. & rd /s/q foobar
|
|||
|
||||
echo ------------ Testing move ------------
|
||||
mkdir foobar & cd foobar
|
||||
echo ... file move ...
|
||||
echo --- file move
|
||||
echo >foo
|
||||
move foo bar > nul 2>&1
|
||||
if not exist foo (
|
||||
|
@ -989,7 +989,7 @@ if errorlevel 1 (
|
|||
echo ErrorLevel: %ErrorLevel%
|
||||
call :setError 0
|
||||
del baz
|
||||
echo ... directory move ...
|
||||
echo --- directory move
|
||||
mkdir foo\bar
|
||||
mkdir baz
|
||||
echo baz2>baz\baz2
|
||||
|
@ -1003,7 +1003,7 @@ call :setError 0
|
|||
mkdir baz
|
||||
move baz baz > nul 2>&1
|
||||
echo moving a directory to itself gives error; errlevel %ErrorLevel%
|
||||
echo ...... dir in dir move ......
|
||||
echo ------ dir in dir move
|
||||
rd /s/q foo
|
||||
mkdir foo bar
|
||||
echo foo2>foo\foo2
|
||||
|
@ -1020,14 +1020,14 @@ cd .. & rd /s/q foobar
|
|||
|
||||
echo ------------ Testing mkdir ------------
|
||||
call :setError 0
|
||||
echo ... md and mkdir are synonymous ...
|
||||
echo --- md and mkdir are synonymous
|
||||
mkdir foobar
|
||||
echo %ErrorLevel%
|
||||
rmdir foobar
|
||||
md foobar
|
||||
echo %ErrorLevel%
|
||||
rmdir foobar
|
||||
echo ... creating an already existing directory/file must fail ...
|
||||
echo --- creating an already existing directory/file must fail
|
||||
mkdir foobar
|
||||
md foobar
|
||||
echo %ErrorLevel%
|
||||
|
@ -1036,7 +1036,7 @@ echo > foobar
|
|||
mkdir foobar
|
||||
echo %ErrorLevel%
|
||||
del foobar
|
||||
echo ... multilevel path creation ...
|
||||
echo --- multilevel path creation
|
||||
mkdir foo
|
||||
echo %ErrorLevel%
|
||||
mkdir foo\bar\baz
|
||||
|
@ -1061,13 +1061,13 @@ rmdir bar
|
|||
cd ..
|
||||
rmdir foo
|
||||
echo %ErrorLevel%
|
||||
echo ... trailing backslashes ...
|
||||
echo --- trailing backslashes
|
||||
mkdir foo\\\\
|
||||
echo %ErrorLevel%
|
||||
if exist foo (rmdir foo & echo dir created
|
||||
) else ( echo dir not created )
|
||||
echo %ErrorLevel%
|
||||
echo ... invalid chars ...
|
||||
echo --- invalid chars
|
||||
mkdir ?
|
||||
echo mkdir ? gives errorlevel %ErrorLevel%
|
||||
call :setError 0
|
||||
|
@ -1093,7 +1093,7 @@ if not exist foo (
|
|||
cd ..
|
||||
rmdir foo
|
||||
)
|
||||
echo ... multiple directories at once ...
|
||||
echo --- multiple directories at once
|
||||
mkdir foobaz & cd foobaz
|
||||
mkdir foo bar\baz foobar
|
||||
if exist foo (echo foo created) else echo foo not created!
|
||||
|
@ -1174,13 +1174,13 @@ cd .. & rd /s/q foobaz
|
|||
|
||||
echo ------------ Testing pushd/popd ------------
|
||||
cd
|
||||
echo ...popd is no-op when dir stack is empty
|
||||
echo --- popd is no-op when dir stack is empty
|
||||
popd
|
||||
cd
|
||||
echo ...pushing non-existing dir
|
||||
echo --- pushing non-existing dir
|
||||
pushd foobar
|
||||
cd
|
||||
echo ...basic behaviour
|
||||
echo --- basic behaviour
|
||||
mkdir foobar\baz
|
||||
pushd foobar
|
||||
cd
|
||||
|
@ -1211,7 +1211,7 @@ mkdir foobar & cd foobar
|
|||
echo foo original contents> foo
|
||||
attrib foo
|
||||
echo > bar
|
||||
echo ... read-only attribute
|
||||
echo --- read-only attribute
|
||||
rem Read-only files cannot be altered or deleted, unless forced
|
||||
attrib +R foo
|
||||
attrib foo
|
||||
|
@ -1233,7 +1233,7 @@ if not exist foo (
|
|||
del foo
|
||||
)
|
||||
cd .. & rd /s/q foobar
|
||||
echo ... recursive behaviour
|
||||
echo --- recursive behaviour
|
||||
mkdir foobar\baz & cd foobar
|
||||
echo > level1
|
||||
echo > whatever
|
||||
|
@ -1247,7 +1247,7 @@ attrib baz\level2
|
|||
echo > bar
|
||||
attrib bar
|
||||
cd .. & rd /s/q foobar
|
||||
echo ... folders processing
|
||||
echo --- folders processing
|
||||
mkdir foobar
|
||||
attrib foobar
|
||||
cd foobar
|
||||
|
@ -1267,10 +1267,10 @@ echo ------------ Testing assoc ------------
|
|||
rem FIXME Can't test error messages in the current test system, so we have to use some kludges
|
||||
rem FIXME Revise once || conditional execution is fixed
|
||||
mkdir foobar & cd foobar
|
||||
echo ...setting association
|
||||
echo --- setting association
|
||||
assoc .foo > baz
|
||||
type baz
|
||||
echo ***
|
||||
echo ---
|
||||
|
||||
assoc .foo=bar
|
||||
assoc .foo
|
||||
|
@ -1281,26 +1281,26 @@ echo echo +++>> tmp.cmd
|
|||
echo assoc .foo>> tmp.cmd
|
||||
cmd /c tmp.cmd
|
||||
|
||||
echo ...resetting association
|
||||
echo --- resetting association
|
||||
assoc .foo=
|
||||
assoc .foo > baz
|
||||
type baz
|
||||
echo ***
|
||||
echo ---
|
||||
|
||||
rem association removal set system-wide
|
||||
cmd /c tmp.cmd > baz
|
||||
type baz
|
||||
echo ***
|
||||
echo ---
|
||||
cd .. & rd /s/q foobar
|
||||
|
||||
echo ------------ Testing ftype ------------
|
||||
rem FIXME Can't test error messages in the current test system, so we have to use some kludges
|
||||
rem FIXME Revise once || conditional execution is fixed
|
||||
mkdir foobar & cd foobar
|
||||
echo ...setting association
|
||||
echo --- setting association
|
||||
ftype footype> baz
|
||||
type baz
|
||||
echo ***
|
||||
echo ---
|
||||
|
||||
ftype footype=foo_opencmd
|
||||
assoc .foo=footype
|
||||
|
@ -1312,7 +1312,7 @@ echo echo +++>> tmp.cmd
|
|||
echo ftype footype>> tmp.cmd
|
||||
cmd /c tmp.cmd
|
||||
|
||||
echo ...resetting association
|
||||
echo --- resetting association
|
||||
assoc .foo=
|
||||
|
||||
rem Removing a file type association doesn't work on XP due to a bug, so a workaround is needed
|
||||
|
@ -1337,7 +1337,7 @@ cd .. & rd /s/q foobar
|
|||
|
||||
echo ------------ Testing CALL ------------
|
||||
mkdir foobar & cd foobar
|
||||
echo ... external script ...
|
||||
echo --- external script
|
||||
echo echo foo %%1> foo.cmd
|
||||
call foo
|
||||
call foo.cmd 8
|
||||
|
@ -1350,7 +1350,7 @@ call foo.cmd foo ''
|
|||
call foo.cmd '' bar
|
||||
del foo.cmd
|
||||
|
||||
echo ... internal routines ...
|
||||
echo --- internal routines
|
||||
call :testRoutine :testRoutine
|
||||
goto :endTestRoutine
|
||||
:testRoutine
|
||||
|
@ -1370,7 +1370,7 @@ echo %1 %2
|
|||
goto :eof
|
||||
:endTestRoutineArgs
|
||||
|
||||
echo ... with builtins ...
|
||||
echo --- with builtins
|
||||
call mkdir foo
|
||||
echo %ErrorLevel%
|
||||
if exist foo (echo foo created) else echo foo should exist!
|
||||
|
@ -1417,7 +1417,7 @@ goto :eof
|
|||
|
||||
echo ------------ Testing cmd invocation ------------
|
||||
rem FIXME: only a stub ATM
|
||||
echo ... a batch file can delete itself ...
|
||||
echo --- a batch file can delete itself
|
||||
echo del foo.cmd>foo.cmd
|
||||
cmd /q /c foo.cmd
|
||||
if not exist foo.cmd (
|
||||
|
@ -1426,7 +1426,7 @@ if not exist foo.cmd (
|
|||
echo file should be deleted!
|
||||
del foo.cmd
|
||||
)
|
||||
echo ... a batch file can alter itself ...
|
||||
echo --- a batch file can alter itself
|
||||
echo echo bar^>foo.cmd>foo.cmd
|
||||
cmd /q /c foo.cmd > NUL 2>&1
|
||||
if exist foo.cmd (
|
||||
|
@ -1440,7 +1440,7 @@ echo ------------ Testing setlocal/endlocal ------------
|
|||
call :setError 0
|
||||
rem Note: setlocal EnableDelayedExpansion already tested in the variable delayed expansion test section
|
||||
mkdir foobar & cd foobar
|
||||
echo ...enable/disable extensions
|
||||
echo --- enable/disable extensions
|
||||
setlocal DisableEXTensions
|
||||
echo ErrLev: %ErrorLevel%
|
||||
endlocal
|
||||
|
@ -1453,7 +1453,7 @@ cmd /E:OfF /C tmp.cmd
|
|||
cmd /e:oN /C tmp.cmd
|
||||
|
||||
rem FIXME: creating file before setting envvar value to prevent parsing-time evaluation (due to EnableDelayedExpansion not being implemented/available yet)
|
||||
echo ...setlocal with corresponding endlocal
|
||||
echo --- setlocal with corresponding endlocal
|
||||
echo @echo off> test.cmd
|
||||
echo echo %%VAR%%>> test.cmd
|
||||
echo setlocal>> test.cmd
|
||||
|
@ -1465,7 +1465,7 @@ set VAR=globalval
|
|||
call test.cmd
|
||||
echo %VAR%
|
||||
set VAR=
|
||||
echo ...setlocal with no corresponding endlocal
|
||||
echo --- setlocal with no corresponding endlocal
|
||||
echo @echo off> test.cmd
|
||||
echo echo %%VAR%%>> test.cmd
|
||||
echo setlocal>> test.cmd
|
||||
|
|
|
@ -134,7 +134,7 @@ bar2
|
|||
|
||||
@pwd@>rem@tab@echo foo & echo bar@space@
|
||||
------------ Testing redirection operators ------------
|
||||
...stdout redirection
|
||||
--- stdout redirection
|
||||
foo
|
||||
foo@space@
|
||||
foo@tab@
|
||||
|
@ -145,7 +145,7 @@ foo9@space@@or_broken@foo@tab@
|
|||
foo1
|
||||
foo11
|
||||
foo12
|
||||
...stdout appending
|
||||
--- stdout appending
|
||||
foo
|
||||
foo@space@
|
||||
foob@space@
|
||||
|
@ -161,7 +161,7 @@ food2
|
|||
food21
|
||||
@todo_wine@foo7@space@@space@@or_broken@not supported@space@
|
||||
@todo_wine@foo@or_broken@not supported
|
||||
...redirections within IF statements
|
||||
--- redirections within IF statements
|
||||
@todo_wine@foo1
|
||||
@todo_wine@foo2
|
||||
@todo_wine@foo3
|
||||
|
@ -255,7 +255,7 @@ e@or_broken@qwerty
|
|||
''@or_broken@'qwerty'
|
||||
r@or_broken@qwerty
|
||||
------------ Testing variable substitution ------------
|
||||
...in FOR variables
|
||||
--- in FOR variables
|
||||
@todo_wine@"A B"
|
||||
C
|
||||
'A B'@or_broken@''
|
||||
|
@ -289,7 +289,7 @@ N
|
|||
@drive@
|
||||
''
|
||||
'.eh'
|
||||
...in parameters
|
||||
--- in parameters
|
||||
@todo_wine@"A B"
|
||||
C
|
||||
@todo_wine@'A B'@or_broken@''
|
||||
|
@ -317,12 +317,12 @@ N
|
|||
''
|
||||
'.eh'@or_broken@''
|
||||
------------ Testing variable delayed expansion ------------
|
||||
...default mode (load-time expansion)
|
||||
--- default mode (load-time expansion)
|
||||
foo
|
||||
!FOO!
|
||||
foo
|
||||
foo
|
||||
...runtime (delayed) expansion mode
|
||||
--- runtime (delayed) expansion mode
|
||||
foo
|
||||
@todo_wine@foo@or_broken@!FOO!
|
||||
foo
|
||||
|
@ -331,25 +331,25 @@ foo
|
|||
0@or_broken@1
|
||||
foo
|
||||
!FOO!
|
||||
...using /V cmd flag
|
||||
--- using /V cmd flag
|
||||
foo
|
||||
@todo_wine@foo@or_broken@!FOO!
|
||||
foo
|
||||
!FOO!
|
||||
------------ Testing conditional execution ------------
|
||||
@todo_wine@...unconditional &
|
||||
--- unconditional ampersand
|
||||
foo1
|
||||
bar2@space@
|
||||
foo2
|
||||
foobar deleted
|
||||
@todo_wine@...on success conditional &&
|
||||
--- on success conditional and
|
||||
@todo_wine@foo3 not created
|
||||
bar4@space@
|
||||
foo4
|
||||
@todo_wine@...on failure conditional ||
|
||||
@todo_wine@foo5
|
||||
@todo_wine@foo6@space@
|
||||
------------ Testing cd ------------
|
||||
--- on failure conditional or
|
||||
foo5
|
||||
foo6@space@
|
||||
@todo_wine@------------ Testing cd ------------
|
||||
singleFile
|
||||
Current dir: @pwd@\foobar@or_broken@Current dir:@space@
|
||||
@pwd@\foobar
|
||||
|
@ -370,10 +370,10 @@ Current dir: @pwd@\foobar@or_broken@Current dir:@space@
|
|||
@pwd@>type foobaz@space@
|
||||
bar
|
||||
|
||||
@pwd@>echo ***@space@
|
||||
***
|
||||
@pwd@>echo ---@space@
|
||||
---
|
||||
bar
|
||||
***
|
||||
---
|
||||
------------ Testing NUL ------------
|
||||
bar
|
||||
bar
|
||||
|
@ -403,7 +403,7 @@ quake
|
|||
quake
|
||||
quake
|
||||
------------ Testing for ------------
|
||||
...plain FOR
|
||||
--- plain FOR
|
||||
A
|
||||
B
|
||||
C
|
||||
|
@ -440,7 +440,7 @@ B'
|
|||
@todo_wine@"echo A B"
|
||||
@todo_wine@"A B"
|
||||
C
|
||||
...imbricated FORs
|
||||
--- imbricated FORs
|
||||
@todo_wine@X Y
|
||||
@todo_wine@X Y
|
||||
@todo_wine@A C
|
||||
|
@ -451,13 +451,13 @@ C
|
|||
@todo_wine@A D
|
||||
@todo_wine@B C
|
||||
@todo_wine@B D
|
||||
...basic wildcards
|
||||
--- basic wildcards
|
||||
bazbaz
|
||||
...for /d
|
||||
--- for /d
|
||||
baz
|
||||
foo
|
||||
bar
|
||||
...for /L
|
||||
--- for /L
|
||||
1
|
||||
3
|
||||
5
|
||||
|
@ -470,8 +470,8 @@ bar
|
|||
-1
|
||||
@todo_wine@ErrorLevel 0
|
||||
@todo_wine@ErrorLevel 0
|
||||
...for /a
|
||||
......individual operations
|
||||
--- for /a
|
||||
------ individual operations
|
||||
0
|
||||
@todo_wine@3
|
||||
@todo_wine@-1
|
||||
|
@ -509,7 +509,7 @@ bar
|
|||
@todo_wine@4
|
||||
@todo_wine@6
|
||||
@todo_wine@1
|
||||
......precedence and grouping
|
||||
------ precedence and grouping
|
||||
@todo_wine@4
|
||||
@todo_wine@10
|
||||
@todo_wine@18@or_broken@10
|
||||
|
@ -518,12 +518,12 @@ bar
|
|||
0@or_broken@4
|
||||
@todo_wine@4
|
||||
@todo_wine@3@or_broken@4
|
||||
......octal and hexadecimal
|
||||
------ octal and hexadecimal
|
||||
@todo_wine@3@or_broken@4
|
||||
@todo_wine@18
|
||||
@todo_wine@18
|
||||
@todo_wine@15
|
||||
......variables
|
||||
------ variables
|
||||
@todo_wine@3
|
||||
@todo_wine@3@or_broken@foo not defined
|
||||
@todo_wine@3@or_broken@0
|
||||
|
@ -540,26 +540,26 @@ bar
|
|||
0
|
||||
@todo_wine@5@or_broken@0
|
||||
|
||||
...for /F
|
||||
......string argument
|
||||
--- for /F
|
||||
------ string argument
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
......fileset argument
|
||||
.........basic blank handling
|
||||
------ fileset argument
|
||||
--------- basic blank handling
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
b
|
||||
.........multi-line with empty lines
|
||||
--------- multi-line with empty lines
|
||||
a
|
||||
b
|
||||
c
|
||||
.........multiple files
|
||||
--------- multiple files
|
||||
a
|
||||
b
|
||||
c
|
||||
|
@ -570,13 +570,13 @@ kkk
|
|||
a
|
||||
b
|
||||
c
|
||||
......eol option
|
||||
------ eol option
|
||||
@todo_wine@ad
|
||||
@todo_wine@z@y
|
||||
@todo_wine@a|d
|
||||
@todo_wine@no output
|
||||
@todo_wine@no output
|
||||
......delims option
|
||||
------ delims option
|
||||
@todo_wine@a
|
||||
@todo_wine@a@space@
|
||||
@todo_wine@a d
|
||||
|
@ -584,7 +584,7 @@ c
|
|||
@todo_wine@C r
|
||||
@todo_wine@foo bar baz
|
||||
@todo_wine@c:\
|
||||
......skip option
|
||||
------ skip option
|
||||
@todo_wine@c
|
||||
@todo_wine@no output
|
||||
@todo_wine@no output
|
||||
|
@ -597,22 +597,22 @@ del /q * succeeded on file1
|
|||
del /q * succeeded on file2.dat
|
||||
------------ Testing del /s ------------
|
||||
------------ Testing rename ------------
|
||||
... ren and rename are synonymous ...
|
||||
--- ren and rename are synonymous
|
||||
foo renamed to bar
|
||||
bar renamed to foo
|
||||
... name collision ...
|
||||
--- name collision
|
||||
foo
|
||||
bar
|
||||
... rename read-only files ...
|
||||
--- rename read-only files
|
||||
read-only file renamed
|
||||
... rename directories ...
|
||||
--- rename directories
|
||||
dir renamed
|
||||
read-only dir renamed
|
||||
... rename in other directory ...
|
||||
--- rename in other directory
|
||||
@todo_wine@rename impossible in other directory
|
||||
@todo_wine@original file still present
|
||||
------------ Testing move ------------
|
||||
... file move ...
|
||||
--- file move
|
||||
file move succeeded
|
||||
@todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible!
|
||||
@todo_wine@bar@or_broken@baz
|
||||
|
@ -620,21 +620,21 @@ read-only files are moveable
|
|||
file moved in subdirectory
|
||||
@todo_wine@moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
|
||||
@todo_wine@ErrorLevel: 0@or_broken@ErrorLevel: 1
|
||||
... directory move ...
|
||||
--- directory move
|
||||
simple directory move succeeded
|
||||
moving a directory to itself gives error; errlevel 1
|
||||
...... dir in dir move ......
|
||||
------ dir in dir move
|
||||
foo
|
||||
bar2
|
||||
foo2
|
||||
------------ Testing mkdir ------------
|
||||
... md and mkdir are synonymous ...
|
||||
--- md and mkdir are synonymous
|
||||
0
|
||||
0
|
||||
... creating an already existing directory/file must fail ...
|
||||
--- creating an already existing directory/file must fail
|
||||
1
|
||||
1
|
||||
... multilevel path creation ...
|
||||
--- multilevel path creation
|
||||
0
|
||||
0
|
||||
0
|
||||
|
@ -643,18 +643,18 @@ foo2
|
|||
1
|
||||
0
|
||||
0
|
||||
... trailing backslashes ...
|
||||
--- trailing backslashes
|
||||
0
|
||||
dir created
|
||||
0
|
||||
... invalid chars ...
|
||||
--- invalid chars
|
||||
mkdir ? gives errorlevel 1
|
||||
mkdir ?\foo gives errorlevel 1
|
||||
mkdir foo\? gives errorlevel 1
|
||||
ok, foo created
|
||||
mkdir foo\bar\? gives errorlevel 1
|
||||
ok, foo\bar created
|
||||
... multiple directories at once ...
|
||||
--- multiple directories at once
|
||||
foo created
|
||||
bar created
|
||||
foobar created
|
||||
|
@ -681,11 +681,11 @@ foobar removed
|
|||
bar\baz removed
|
||||
------------ Testing pushd/popd ------------
|
||||
@pwd@
|
||||
...popd is no-op when dir stack is empty
|
||||
--- popd is no-op when dir stack is empty
|
||||
@pwd@
|
||||
...pushing non-existing dir
|
||||
--- pushing non-existing dir
|
||||
@pwd@
|
||||
...basic behaviour
|
||||
--- basic behaviour
|
||||
@pwd@\foobar
|
||||
@pwd@
|
||||
@pwd@\foobar\baz
|
||||
|
@ -696,18 +696,18 @@ bar\baz removed
|
|||
@pwd@
|
||||
------------ Testing attrib ------------
|
||||
@todo_wine@A @pwd@\foobar\foo@or_broken@A @pwd@\foobar\foo@or_broken@A I @pwd@\foobar\foo
|
||||
... read-only attribute
|
||||
--- read-only attribute
|
||||
@todo_wine@A R @pwd@\foobar\foo@or_broken@A R @pwd@\foobar\foo@or_broken@A R I @pwd@\foobar\foo
|
||||
foo
|
||||
foo original contents
|
||||
Read-only file not deleted
|
||||
Read-only file forcibly deleted
|
||||
... recursive behaviour
|
||||
--- recursive behaviour
|
||||
@todo_wine@A @pwd@\foobar\baz\level2@or_broken@A @pwd@\foobar\baz\level2@or_broken@A I @pwd@\foobar\baz\level2
|
||||
@todo_wine@A R @pwd@\foobar\level1@or_broken@A R @pwd@\foobar\level1@or_broken@A R I @pwd@\foobar\level1
|
||||
@todo_wine@A R @pwd@\foobar\baz\level2@or_broken@A R @pwd@\foobar\baz\level2@or_broken@A R I @pwd@\foobar\baz\level2
|
||||
@todo_wine@A @pwd@\foobar\bar@or_broken@A @pwd@\foobar\bar@or_broken@A I @pwd@\foobar\bar
|
||||
... folders processing
|
||||
--- folders processing
|
||||
@todo_wine@ @pwd@\foobar@or_broken@ @pwd@\foobar@or_broken@ I @pwd@\foobar
|
||||
@todo_wine@ R @pwd@\foobar\baz@or_broken@ R @pwd@\foobar\baz@or_broken@ @pwd@\foobar\baz@or_broken@ R I @pwd@\foobar\baz
|
||||
@todo_wine@A @pwd@\foobar\baz\toto@or_broken@A @pwd@\foobar\baz\toto@or_broken@A I @pwd@\foobar\baz\toto
|
||||
|
@ -715,28 +715,28 @@ toto
|
|||
lulu
|
||||
file created in read-only dir
|
||||
------------ Testing assoc ------------
|
||||
...setting association
|
||||
***
|
||||
--- setting association
|
||||
---
|
||||
.foo=bar
|
||||
.foo=bar
|
||||
+++
|
||||
.foo=bar
|
||||
...resetting association
|
||||
***
|
||||
--- resetting association
|
||||
---
|
||||
+++
|
||||
***
|
||||
---
|
||||
------------ Testing ftype ------------
|
||||
...setting association
|
||||
***
|
||||
--- setting association
|
||||
---
|
||||
footype=foo_opencmd
|
||||
.foo=footype
|
||||
footype=foo_opencmd
|
||||
+++
|
||||
footype=foo_opencmd
|
||||
...resetting association
|
||||
--- resetting association
|
||||
@todo_wine@original value@or_broken@buggyXP@or_broken@!FOO!
|
||||
------------ Testing CALL ------------
|
||||
... external script ...
|
||||
--- external script
|
||||
foo@space@
|
||||
foo 8
|
||||
foo@space@@space@
|
||||
|
@ -745,7 +745,7 @@ foo bar@space@
|
|||
@todo_wine@"" bar@space@
|
||||
foo ''@space@
|
||||
'' bar@space@
|
||||
... internal routines ...
|
||||
--- internal routines
|
||||
bar :testRoutine
|
||||
foo@space@
|
||||
foo bar
|
||||
|
@ -753,7 +753,7 @@ foo bar
|
|||
@todo_wine@"" bar
|
||||
foo ''
|
||||
'' bar
|
||||
... with builtins ...
|
||||
--- with builtins
|
||||
@todo_wine@0
|
||||
@todo_wine@foo created
|
||||
@todo_wine@Should expand foobaz
|
||||
|
@ -770,23 +770,23 @@ non-builtin dir
|
|||
'p3' 'p5' '' '' ''
|
||||
'p5' '' '' '' ''
|
||||
------------ Testing cmd invocation ------------
|
||||
... a batch file can delete itself ...
|
||||
--- a batch file can delete itself
|
||||
file correctly deleted
|
||||
... a batch file can alter itself ...
|
||||
--- a batch file can alter itself
|
||||
@todo_wine@bar
|
||||
------------ Testing setlocal/endlocal ------------
|
||||
...enable/disable extensions
|
||||
--- enable/disable extensions
|
||||
@todo_wine@ErrLev:@space@
|
||||
ErrLev: 0
|
||||
ErrLev: 0
|
||||
@todo_wine@ErrLev:@space@@or_broken@ErrLev: 0
|
||||
ErrLev: 0
|
||||
...setlocal with corresponding endlocal
|
||||
--- setlocal with corresponding endlocal
|
||||
globalval
|
||||
localval
|
||||
globalval
|
||||
globalval
|
||||
...setlocal with no corresponding endlocal
|
||||
--- setlocal with no corresponding endlocal
|
||||
globalval
|
||||
localval
|
||||
@todo_wine@globalval
|
||||
|
|
Loading…
Reference in a new issue