[PATCH 1/2] cmd: Tests for "choice"

Alexander Coffin alexcoffin1999 at gmail.com
Tue Dec 18 14:07:20 CST 2018


From: alex <alexcoffin1999 at gmail.com>

Added currently unsuccessful tests for the "choice" command.

Signed-off-by: Alexander Coffin <alexcoffin1999 at 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' ------------
+ at todo_wine@Example message [A,B,C]?A
+ at todo_wine@1
+ at todo_wine@Example message [A,B,C]?B
+ at todo_wine@2
+ at todo_wine@[D,E,F]?F
+ at todo_wine@3
+ at todo_wine@[A,B,C,X,Y,Z]?Y
+ at todo_wine@5
+ at todo_wine@A
+ at todo_wine@1
+ at todo_wine@[a,b,c,A,B,C]?A
+ at todo_wine@4
+ at todo_wine@255
 ------------ Testing variable expansion ------------
 ~p0 should be path containing batch file
 @path@
-- 
2.7.4




More information about the wine-devel mailing list