From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- programs/cmd/tests/test_builtins.cmd | 34 ++++++++++++++++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 32 +++++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index fed8c20c587..ba8a2cb7619 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -591,6 +591,40 @@ call :setError 666 & rmdir abc & echo ERRORLEVEL !errorlevel! call :setError 666 & rmdir @:\cba\abc & echo ERRORLEVEL !errorlevel! cd .. && rd /q /s foo
+echo --- success/failure for SETLOCAL/ENDLOCAL commands +call :setError 666 & (setlocal foobar &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (setlocal &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (endlocal foobar &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (setlocal DisableExtensions &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (setlocal EnableExtensions &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +echo --- success/failure for DATE command +call :setError 666 & (date /t >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (date AAAA >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +rem need evelated priviledges to set the date +echo --- success/failure for TIME command +call :setError 666 & (time /t >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (time AAAA >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +rem need evelated priviledges to set the time +echo --- success/failure for BREAK command +call :setError 666 & (break &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (break 345 &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +echo --- success/failure for VER command +call :setError 666 & (ver >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (ver foo >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (ver /f >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +echo --- success/failure for VERIFY command +call :setError 666 & (verify >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (verify on >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (verify foobar >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +echo --- success/failure for VOL command +call :setError 666 & (vol >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (vol c: >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (vol foobar >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +call :setError 666 & (vol /Z >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +echo --- success/failure for LABEL command +call :setError 666 & (label /Z >NUL &&echo SUCCESS !errorlevel!||echo FAILURE !errorlevel!) +rem need evelated priviledges to test + echo --- setlocal DisableDelayedExpansion echo ------------ Testing 'set' ------------ diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index c7119858d85..75152663850 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -535,7 +535,37 @@ ERRORLEVEL 666 ERRORLEVEL 666 ERRORLEVEL 666 ERRORLEVEL 666 ---- +--- success/failure for SETLOCAL/ENDLOCAL commands +@todo_wine@FAILURE 1 +@todo_wine@SUCCESS 0 +SUCCESS 666 +@todo_wine@SUCCESS@space@ +@todo_wine@SUCCESS 0 +--- success/failure for DATE command +@todo_wine@SUCCESS 0 +@todo_wine@FAILURE 1 +--- success/failure for TIME command +@todo_wine@SUCCESS 0 +@todo_wine@FAILURE 1 +--- success/failure for BREAK command +@todo_wine@SUCCESS 666 +@todo_wine@SUCCESS 666 +--- success/failure for VER command +@todo_wine@SUCCESS 0 +@todo_wine@SUCCESS 0 +@todo_wine@FAILURE 1 +--- success/failure for VERIFY command +@todo_wine@SUCCESS 0 +@todo_wine@SUCCESS 0 +@todo_wine@FAILURE 1 +--- success/failure for VOL command +@todo_wine@SUCCESS 0 +@todo_wine@SUCCESS 0 +@todo_wine@FAILURE 1 +@todo_wine@FAILURE 1 +--- success/failure for LABEL command +@todo_wine@FAILURE 1 +@todo_wine@--- ------------ Testing 'set' ------------ 1 0