cmd/tests: Add tests for SHIFT builtin
Frédéric Delanoy
frederic.delanoy at gmail.com
Tue Sep 13 05:06:45 CDT 2011
---
programs/cmd/tests/test_builtins.cmd | 20 ++++++++++++++++++++
programs/cmd/tests/test_builtins.cmd.exp | 7 +++++++
2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 046e6e4..1425e5c 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -1256,6 +1256,26 @@ echo echo non-builtin dir> dir.cmd
call dir /b
cd .. & rd /s/q foobar
+echo ------------ Testing SHIFT ------------
+
+call :shiftFun p1 p2 p3 p4 p5
+goto :endShiftFun
+
+:shiftFun
+echo '%1' '%2' '%3' '%4' '%5'
+shift
+echo '%1' '%2' '%3' '%4' '%5'
+shift at tab@ /1
+echo '%1' '%2' '%3' '%4' '%5'
+shift /2
+echo '%1' '%2' '%3' '%4' '%5'
+shift /-1
+echo '%1' '%2' '%3' '%4' '%5'
+shift /0
+echo '%1' '%2' '%3' '%4' '%5'
+goto :eof
+:endShiftFun
+
echo ------------ Testing cmd invocation ------------
rem FIXME: only a stub ATM
echo ... a batch file can delete itself ...
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 1e2e3df..1b48321 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -723,6 +723,13 @@ foo ''
@todo_wine at 1
@todo_wine at 1
non-builtin dir
+------------ Testing SHIFT ------------
+'p1' 'p2' 'p3' 'p4' 'p5'
+'p2' 'p3' 'p4' 'p5' ''
+'p3' 'p4' 'p5' '' ''
+'p3' 'p5' '' '' ''
+'p3' 'p5' '' '' ''
+'p5' '' '' '' ''
------------ Testing cmd invocation ------------
... a batch file can delete itself ...
file correctly deleted
--
1.7.6
More information about the wine-patches
mailing list