Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
3c8674a7
Commit
3c8674a7
authored
Aug 01, 2011
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Aug 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/tests: Add tests for variable delayed expansion.
parent
bb44fe56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
test_builtins.cmd
programs/cmd/tests/test_builtins.cmd
+40
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+15
-0
No files found.
programs/cmd/tests/test_builtins.cmd
View file @
3c8674a7
...
...
@@ -168,6 +168,46 @@ echo P%ERRORLEVEL%
echo %ERRORLEVEL%S
echo P%ERRORLEVEL%S
echo ------------ Testing variable delayed expansion --------------
rem NT4 doesn't support this
echo ...default mode (load-time expansion)
set FOO=foo
echo %FOO%
echo !FOO!
if %FOO% == foo (
set FOO=bar
if %FOO% == bar (echo bar) else echo foo
)
set FOO=foo
if %FOO% == foo (
set FOO=bar
if !FOO! == bar (echo bar) else echo foo
)
echo ...runtime (delayed) expansion mode
setlocal EnableDelayedExpansion
set FOO=foo
echo %FOO%
echo !FOO!
if %FOO% == foo (
set FOO=bar
if %FOO% == bar (echo bar) else echo foo
)
set FOO=foo
if %FOO% == foo (
set FOO=bar
if !FOO! == bar (echo bar) else echo foo
)
echo %ErrorLevel%
setlocal DisableDelayedExpansion
echo %ErrorLevel%
set FOO=foo
echo %FOO%
echo !FOO!
set FOO=
echo ------------ Testing conditional execution --------------
echo ...unconditional ^&
call :setError 123 & echo foo1
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
3c8674a7
...
...
@@ -146,6 +146,21 @@ ERRORLEVEL
P0
0S
P0S
------------ Testing variable delayed expansion --------------
...default mode (load-time expansion)
foo
!FOO!
foo
foo
...runtime (delayed) expansion mode
foo
@todo_wine@foo@or_broken@!FOO!
foo
@todo_wine@bar@or_broken@foo
0
0@or_broken@1
foo
!FOO!
------------ Testing conditional execution --------------
@todo_wine@...unconditional &
foo1
...
...
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