Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olivier F. R. Dierick
wine
Commits
67873bdc
Commit
67873bdc
authored
13 years ago
by
Dan Kegel
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
cmd: Add simple test for %errorlevel%.
parent
61159515
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
programs/cmd/tests/test_builtins.cmd
+26
-0
26 additions, 0 deletions
programs/cmd/tests/test_builtins.cmd
programs/cmd/tests/test_builtins.cmd.exp
+8
-0
8 additions, 0 deletions
programs/cmd/tests/test_builtins.cmd.exp
with
34 additions
and
0 deletions
programs/cmd/tests/test_builtins.cmd
+
26
−
0
View file @
67873bdc
...
...
@@ -94,6 +94,24 @@ del /a:r *.test
if not exist r.test echo r.test not found after delete, good
if exist r.test echo r.test found after delete, bad
echo -----------Testing Errorlevel-----------
rem nt 4.0 doesn'
t
really
support
a
way
of
setting
errorlevel
,
so
this
is
weak
rem See http://www.robvanderwoude.com/exit.php
call
:setError
1
echo
%ErrorLevel%
if
errorlevel
2
echo
errorlevel
too
high
,
bad
if
errorlevel
1
echo
errorlevel
just
right
,
good
call
:setError
0
echo
abc
%ErrorLevel%
def
if
errorlevel
1
echo
errorlevel
nonzero
,
bad
if
not
errorlevel
1
echo
errorlevel
zero
,
good
rem Now verify that setting a real variable hides its magic variable
set
errorlevel
=
7
echo
%ErrorLevel%
should
be
7
if
errorlevel
7
echo
setting
var
worked
too
well
,
bad
call
:setError
3
echo
%ErrorLevel%
should
still
be
7
echo
---------
--Testing
GOTO
-----------
if
a
==
a
goto
dest1
:dest
1
...
...
@@ -107,3 +125,11 @@ echo goto with a leading tab worked
if
d
==
d
goto
dest4
:dest
4
@space@
echo
goto
with
a
following
space
worked
echo
---------
--Done
,
jumping
to
EOF
-----------
goto
:eof
rem Subroutine to set errorlevel and return
rem in windows nt 4.0, this always sets errorlevel 1, since /b isn't supported
:setError
exit
/B
%
1
rem This line runs under cmd in windows NT 4, but not in more modern versions.
This diff is collapsed.
Click to expand it.
programs/cmd/tests/test_builtins.cmd.exp
+
8
−
0
View file @
67873bdc
...
...
@@ -82,8 +82,16 @@ if /I seems to work
not-r.test not found after delete, good
r.test found before delete, good
r.test not found after delete, good
-----------Testing Errorlevel-----------
1
errorlevel just right, good
abc0def@or_broken@abc1def
errorlevel zero, good@or_broken@errorlevel nonzero, bad
7 should be 7
7 should still be 7
-----------Testing GOTO-----------
goto with no leading space worked
goto with a leading space worked
goto with a leading tab worked
goto with a following space worked
-----------Done, jumping to EOF-----------
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment