From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- programs/cmd/tests/test_builtins.cmd | 20 ++++++++++++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 11 +++++++++++ 2 files changed, 31 insertions(+)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index c0707e129b5..77207318223 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -2711,7 +2711,13 @@ echo>robinfile if 1==1 call del batfile dir /b if exist batfile echo batfile shouldn't exist +rem arcane command, first resets errorlevel, second sets it to one +(call ) +echo %ErrorLevel% +(call) +echo %ErrorLevel% rem ... but not for 'if' or 'for' +call :setError 0 call if 1==1 echo bar 2> nul echo %ErrorLevel% call :setError 0 @@ -2738,6 +2744,20 @@ call if 1==1 ( call call call echo passed cd .. & rd /s/q foobar
+echo --- mixing batch and builtins +erase /q echo.bat test.bat 2> NUL +echo @echo foo> echo.bat +echo @echo bar> test.bat & call test.bat +echo @echo.bat bar> test.bat & call test.bat +echo @call echo bar> test.bat & call test.bat +echo @call echo.bat bar> test.bat & call test.bat +erase /q echo.bat 2> NUL +echo @echo bar> test.bat & call test.bat +echo @echo.bat bar> test.bat & call test.bat +echo @call echo bar> test.bat & call test.bat +echo @call echo.bat bar> test.bat & call test.bat +erase /q test.bat 2> NUL + echo ------------ Testing SHIFT ------------
call :shiftFun p1 p2 p3 p4 p5 diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 7146bdaf26b..026befada11 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -1537,6 +1537,8 @@ foo created Should expand foobaz batfile robinfile +0 +@todo_wine@1 1 1 non-builtin dir @@ -1545,6 +1547,15 @@ Line two Get if ... and else! passed +--- mixing batch and builtins +bar@space@ +@todo_wine@foo +foo +foo +bar@space@ +bat bar@space@ +bar@space@ +bat bar@space@ ------------ Testing SHIFT ------------ 'p1' 'p2' 'p3' 'p4' 'p5' 'p2' 'p3' 'p4' 'p5' ''