=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: cmd/tests: Add tests for combined CALLs/GOTOs.

Alexandre Julliard julliard at winehq.org
Mon Sep 12 11:43:00 CDT 2011


Module: wine
Branch: master
Commit: 195ee2f3776681d4e4fb4f8a2fd0cdfd708c5dcf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=195ee2f3776681d4e4fb4f8a2fd0cdfd708c5dcf

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Sun Sep 11 17:14:56 2011 +0200

cmd/tests: Add tests for combined CALLs/GOTOs.

---

 programs/cmd/tests/test_builtins.cmd     |   47 ++++++++++++++++++++++++++++++
 programs/cmd/tests/test_builtins.cmd.exp |   10 ++++++-
 2 files changed, 56 insertions(+), 1 deletions(-)

diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 88265f7..046e6e4 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -1353,6 +1353,53 @@ if d==d goto dest4
 :dest4 at space@
 echo goto with a following space worked
 
+echo ---------- Testing combined CALLs/GOTOs -----------
+echo @echo off>foo.cmd
+echo goto :eof>>foot.cmd
+echo :eof>>foot.cmd
+echo echo world>>foo.cmd
+
+echo @echo off>foot.cmd
+echo echo cheball>>foot.cmd
+echo.>>foot.cmd
+echo call :bar>>foot.cmd
+echo if "%%1"=="deleteMe" (del foot.cmd)>>foot.cmd
+echo goto :eof>>foot.cmd
+echo.>>foot.cmd
+echo :bar>>foot.cmd
+echo echo barbare>>foot.cmd
+echo goto :eof>>foot.cmd
+
+call foo.cmd
+call foot
+call :bar
+del foo.cmd
+rem Script execution stops after the following line
+foot deleteMe
+call :foo
+call :foot
+goto :endFuns
+
+:foot
+echo foot
+
+:foo
+echo foo
+goto :eof
+
+:endFuns
+
+:bar
+echo bar
+call :foo
+
+:baz
+echo baz
+goto :eof
+
+echo Final message is not output since earlier 'foot' processing stops script execution
+echo Do NOT add any tests below this line
+
 echo -----------Done, jumping to EOF-----------
 goto :eof
 rem Subroutine to set errorlevel and return
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index b9285b1..1e2e3df 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -757,4 +757,12 @@ 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-----------
+---------- Testing combined CALLs/GOTOs -----------
+world
+cheball
+barbare
+bar
+foo
+baz
+cheball
+barbare




More information about the wine-cvs mailing list