cmd/tests: Add SET tests.

This commit is contained in:
Frédéric Delanoy 2011-07-17 22:48:56 +02:00 committed by Alexandre Julliard
parent 437cec1a49
commit 79926d6f2b
2 changed files with 56 additions and 0 deletions

View File

@ -29,11 +29,47 @@ echo word@space@
echo word@space@@space@
echo ------------ Testing 'set' --------------
echo %ErrorLevel%
set FOOBAR 2> nul > nul
echo %ErrorLevel%
set FOOBAR = baz
echo %ErrorLevel%
echo %FOOBAR%FOOBAR not defined
echo %FOOBAR %
set FOOBAR 2> nul
set FOOBAR = baz2
echo %ErrorLevel%
echo %fOObAr %
set FOOBAR= bar
echo %ErrorLevel%
echo %FOOBAR%
set FOO
set FOOBAR=
set FOOB
echo %FOOBAR%FOOBAR not defined
set FOOBAR =
set FOOBA 2> nul > nul
echo %ErrorLevel%
set FOO=bar
echo %FOO%
set FOO=foo
set BAR=bar
echo %FOO%%BAR%
set BAR=
set FOO=
set FOO=%FOO%
echo %FOO%FOO not defined
set BAZ%=bazbaz
set BA
echo %BAZ%%
set BAZ%=
echo set "FOO=bar" should not include the quotes in the variable value
set "FOO=bar"
echo %FOO%
set FOO=
echo ------------ Testing variable expansion --------------
call :setError 0
echo ~dp0 should be directory containing batch file
echo %~dp0
mkdir dummydir

View File

@ -48,6 +48,26 @@ word
word@space@
word@space@@space@
------------ Testing 'set' --------------
0
1
@todo_wine@0
FOOBAR not defined
@todo_wine@ baz
FOOBAR = baz
@todo_wine@0
@todo_wine@ baz2
@todo_wine@0
bar
@todo_wine@FOOBAR= bar
@todo_wine@FOOBAR = baz2
FOOBAR = baz
FOOBAR not defined
1
bar
foobar
FOO not defined
BAZ=bazbaz
bazbaz
set "FOO=bar" should not include the quotes in the variable value
bar
------------ Testing variable expansion --------------