From ad064b44ed7a773e4fdf6dab9cda240ae6172c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delanoy?= Date: Tue, 13 Sep 2011 12:06:45 +0200 Subject: [PATCH] cmd/tests: Add tests for SHIFT builtin. --- programs/cmd/tests/test_builtins.cmd | 20 ++++++++++++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 7 +++++++ 2 files changed, 27 insertions(+) diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index 7551e573188..cd30e4fa6a3 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@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 733e1d512df..19536feefe5 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -729,6 +729,13 @@ foo '' @todo_wine@1 @todo_wine@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