Commit 79926d6f authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

cmd/tests: Add SET tests.

parent 437cec1a
...@@ -29,11 +29,47 @@ echo word@space@ ...@@ -29,11 +29,47 @@ echo word@space@
echo word@space@@space@ echo word@space@@space@
echo ------------ Testing 'set' -------------- 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 echo set "FOO=bar" should not include the quotes in the variable value
set "FOO=bar" set "FOO=bar"
echo %FOO% echo %FOO%
set FOO=
echo ------------ Testing variable expansion -------------- echo ------------ Testing variable expansion --------------
call :setError 0
echo ~dp0 should be directory containing batch file echo ~dp0 should be directory containing batch file
echo %~dp0 echo %~dp0
mkdir dummydir mkdir dummydir
......
...@@ -48,6 +48,26 @@ word ...@@ -48,6 +48,26 @@ word
word@space@ word@space@
word@space@@space@ word@space@@space@
------------ Testing 'set' -------------- ------------ 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 set "FOO=bar" should not include the quotes in the variable value
bar bar
------------ Testing variable expansion -------------- ------------ Testing variable expansion --------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment