cmd/tests: Add ^ escape character tests (try 2)
Frédéric Delanoy
frederic.delanoy at gmail.com
Sat Jul 23 13:13:50 CDT 2011
Improved version
---
programs/cmd/tests/test_builtins.cmd | 36 +++++++++++++++++++++++++++++-
programs/cmd/tests/test_builtins.cmd.exp | 21 ++++++++++++++++-
2 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 81a326a..2cffd6a 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -28,8 +28,42 @@ echo .word
echo word at space@
echo word at space@@space@
-echo ------------ Testing 'set' --------------
+echo ------------ Testing ^^ escape character --------------
+rem Using something like "echo foo^" asks for an additional char after a "More?" prompt on the following line; it's not possible to currently test that non-interactively
+echo ^hell^o, world
+echo hell^o, world
+echo hell^^o, world
+echo hell^^^o, world
+mkdir foobar
+echo baz> foobar\baz
+type foobar\baz
+type foobar^\baz
+rd /s/q foobar
+echo foo ^| echo bar
+echo foo ^& echo bar
+call :setError 0
+echo bak ^&& echo baz 2> nul
echo %ErrorLevel%
+echo foo ^> foo
+echo ^<> foo
+type foo
+del foo
+set FOO=oof
+echo ff^%FOO%
+set FOO=bar ^| baz
+set FOO
+rem FIXME: echoing %FOO% gives an error (baz not recognized) but prematurely
+rem exits the script on windows; redirecting stdout and/or stderr doesn't help
+echo %ErrorLevel%
+call :setError 0
+set FOO=bar ^^^| baz
+set FOO
+echo %FOO%
+echo %ErrorLevel%
+set FOO=
+
+echo ------------ Testing 'set' --------------
+call :setError 0
set FOOBAR 2> nul > nul
echo %ErrorLevel%
set FOOBAR = baz
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index c3fee1a..cecadcb 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -47,8 +47,27 @@ word
.word
word at space@
word at space@@space@
+ at todo_wine@------------ Testing ^ escape character --------------
+ at todo_wine@hello, world
+ at todo_wine@hello, world
+ at todo_wine@hell^o, world
+ at todo_wine@hell^o, world
+baz
+ at todo_wine@baz
+ at todo_wine@foo | echo bar
+ at todo_wine@foo & echo bar
+ at todo_wine@bak &
+ at todo_wine@baz at space@
+ at todo_wine@0 at or_broken@1
+ at todo_wine@foo > foo
+ at todo_wine@<
+ at todo_wine@ffoof
+ at todo_wine@FOO=bar | baz
+ at todo_wine@0
+ at todo_wine@FOO=bar ^| baz
+ at todo_wine@bar | baz
+ at todo_wine@0
------------ Testing 'set' --------------
-0
1
@todo_wine at 0
FOOBAR not defined
--
1.7.6
More information about the wine-patches
mailing list