cmd/tests: Add tests for combined CALLs/GOTOs
Frédéric Delanoy
frederic.delanoy at gmail.com
Thu Sep 8 02:45:16 CDT 2011
---
programs/cmd/tests/test_builtins.cmd | 46 ++++++++++++++++++++++++++++++
programs/cmd/tests/test_builtins.cmd.exp | 10 ++++++-
2 files changed, 55 insertions(+), 1 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 9a5f786..9c5cee2 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -1331,6 +1331,52 @@ if d==d goto dest4
:dest4 at space@
echo goto with a following space worked
+echo ---------- Testing combined CALLs/GOTOs -----------
+mkdir foobar & cd foobar
+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 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
+foot
+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
+cd .. & rd /s/q foobar
+
+echo Final message is not output since earlier 'foot' processing stops script
+echo Do NOT 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 514a635..ad0cbae 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -749,4 +749,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
--
1.7.6
More information about the wine-patches
mailing list