From: alex alexcoffin1999@gmail.com
Added currently unsuccessful tests for the "choice" command.
Signed-off-by: Alexander Coffin alexcoffin1999@gmail.com --- programs/cmd/tests/test_builtins.cmd | 18 ++++++++++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 14 ++++++++++++++ 2 files changed, 32 insertions(+)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index 79233d8..ae489eb 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -527,6 +527,24 @@ rmdir "fol;der" rmdir folder PATH=%PATH_BACKUP%
+echo ------------ Testing 'choice' ------------ + +choice /C:ABC /M "Example message" /D A /T:0 +echo %ERRORLEVEL% +choice /C ABC "/M:Example message" /D:B /T 0 +echo %ERRORLEVEL% +choice /C def /D:f /T:0 +echo %ERRORLEVEL% +echo Y | choice /C ABCXYZ /D A /T 2 +echo %ERRORLEVEL% +choice /C ABC /N /D A /T 0 +echo %ERRORLEVEL% +choice /C abcABC /CS /D:A /T:0 +echo %ERRORLEVEL% +rem intentional error +choice /C abcABC /D:A /T:0 > NUL +echo %ERRORLEVEL% + echo ------------ Testing variable expansion ------------ call :setError 0 echo ~p0 should be path containing batch file diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 01ddc4d..1386467 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -479,6 +479,20 @@ foo I'm here!@space@ I'm here!@space@ I'm here!@space@ +------------ Testing 'choice' ------------ +@todo_wine@Example message [A,B,C]?A +@todo_wine@1 +@todo_wine@Example message [A,B,C]?B +@todo_wine@2 +@todo_wine@[D,E,F]?F +@todo_wine@3 +@todo_wine@[A,B,C,X,Y,Z]?Y +@todo_wine@5 +@todo_wine@A +@todo_wine@1 +@todo_wine@[a,b,c,A,B,C]?A +@todo_wine@4 +@todo_wine@255 ------------ Testing variable expansion ------------ ~p0 should be path containing batch file @path@