Module: wine Branch: master Commit: 1e28bbb88ebef47dadced18c8cadc83afc381d27 URL: http://source.winehq.org/git/wine.git/?a=commit;h=1e28bbb88ebef47dadced18c8c...
Author: Frédéric Delanoy frederic.delanoy@gmail.com Date: Sat Jul 23 20:13:50 2011 +0200
cmd/tests: Add ^ escape character tests.
---
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 d94c3e7..8e2539c 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -28,8 +28,42 @@ echo .word echo word@space@ echo word@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 6e842b8..267f83e 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -47,8 +47,27 @@ word .word word@space@ word@space@@space@ +@todo_wine@------------ Testing ^ escape character -------------- +@todo_wine@hello, world +@todo_wine@hello, world +@todo_wine@hell^o, world +@todo_wine@hell^o, world +baz +@todo_wine@baz +@todo_wine@foo | echo bar +@todo_wine@foo & echo bar +@todo_wine@bak & +@todo_wine@baz@space@ +@todo_wine@0@or_broken@1 +@todo_wine@foo > foo +@todo_wine@< +@todo_wine@ffoof +@todo_wine@FOO=bar | baz +@todo_wine@0 +@todo_wine@FOO=bar ^| baz +@todo_wine@bar | baz +@todo_wine@0 ------------ Testing 'set' -------------- -0 1 @todo_wine@0 FOOBAR not defined