Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
fc358a82
Commit
fc358a82
authored
Dec 18, 2018
by
Alexander Coffin
Committed by
Alexandre Julliard
Dec 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/tests: Add some tests for "choice".
Signed-off-by:
Alexander Coffin
<
alexcoffin1999@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
889fe314
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
test_builtins.cmd
programs/cmd/tests/test_builtins.cmd
+42
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+14
-0
No files found.
programs/cmd/tests/test_builtins.cmd
View file @
fc358a82
...
...
@@ -527,6 +527,48 @@ rmdir "fol;der"
rmdir folder
PATH=%PATH_BACKUP%
echo ------------ Testing 'choice' ------------
rem Windows XP and Windows 2000 do not come with choice
rem echo is used for @or_broken@ formatting
choice /C:ABC /M "Example message" /D A /T:0
if %ERRORLEVEL% EQU 9009 (
echo choice unavailable
)
echo %ERRORLEVEL%
choice /C ABC "/M:Example message" /D:B /T 0
if %ERRORLEVEL% EQU 9009 (
echo choice unavailable
)
echo %ERRORLEVEL%
choice /C def /D:f /T:0
if %ERRORLEVEL% EQU 9009 (
echo choice unavailable
)
echo %ERRORLEVEL%
REM If a pipe fails due to a nonexistent command
REM it will stop the whole program's execution
if %ERRORLEVEL% NEQ 9009 (
echo Y | choice /C ABCXYZ /D A /T 2
)
if %ERRORLEVEL% EQU 9009 (
echo choice unavailable
)
echo %ERRORLEVEL%
choice /C ABC /N /D A /T 0
if %ERRORLEVEL% EQU 9009 (
echo choice unavailable
)
echo %ERRORLEVEL%
choice /C abcABC /CS /D:A /T:0
if %ERRORLEVEL% EQU 9009 (
echo choice unavailable
)
echo %ERRORLEVEL%
rem intentional error
choice /C abcABC /D:A /T:0 >NUL 2>NUL
echo %ERRORLEVEL%
echo ------------ Testing variable expansion ------------
call :setError 0
echo ~p0 should be path containing batch file
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
fc358a82
...
...
@@ -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@or_broken@choice unavailable
@todo_wine@1@or_broken@9009
@todo_wine@Example message [A,B,C]?B@or_broken@choice unavailable
@todo_wine@2@or_broken@9009
@todo_wine@[D,E,F]?F@or_broken@choice unavailable
@todo_wine@3@or_broken@9009
@todo_wine@[A,B,C,X,Y,Z]?Y@or_broken@choice unavailable
@todo_wine@5@or_broken@9009
@todo_wine@A@or_broken@choice unavailable
@todo_wine@1@or_broken@9009
@todo_wine@[a,b,c,A,B,C]?A@or_broken@choice unavailable
@todo_wine@4@or_broken@9009
@todo_wine@255@or_broken@9009
------------ Testing variable expansion ------------
~p0 should be path containing batch file
@path@
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment