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

cmd/tests: Add tests for tab handling.

parent 453996fe
...@@ -17,6 +17,14 @@ echo:word ...@@ -17,6 +17,14 @@ echo:word
echo :word echo :word
echo word@space@ echo word@space@
echo word@space@@space@ echo word@space@@space@
echo word
echo@tab@word
echo@tab@word @tab@
echo@tab@word@tab@@space@
@tab@echo word
echo @tab@word
echo @tab@word
echo@tab@@tab@word
@echo off @echo off
echo ------------ Testing 'echo' [OFF] -------------- echo ------------ Testing 'echo' [OFF] --------------
...@@ -35,6 +43,14 @@ echo:word ...@@ -35,6 +43,14 @@ echo:word
echo :word echo :word
echo word@space@ echo word@space@
echo word@space@@space@ echo word@space@@space@
echo word
echo@tab@word
echo@tab@word @tab@
echo@tab@word@tab@@space@
@tab@echo word
echo @tab@word
echo @tab@word
echo@tab@@tab@word
echo ------------ Testing redirection operators -------------- echo ------------ Testing redirection operators --------------
mkdir foobar & cd foobar mkdir foobar & cd foobar
...@@ -140,6 +156,14 @@ set BAZ%= ...@@ -140,6 +156,14 @@ 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@tab@FOO=foo
echo %FOO%
set@tab@FOO=
echo '%FOO%'
set FOO=foo@space@
echo '%FOO%'
set FOO=foo@tab@
echo '%FOO%'
set FOO= set FOO=
echo ------------ Testing variable expansion -------------- echo ------------ Testing variable expansion --------------
...@@ -266,12 +290,18 @@ cd..@space@ ...@@ -266,12 +290,18 @@ cd..@space@
cd cd
if not exist foobar (cd ..) if not exist foobar (cd ..)
cd foobar cd foobar
cd@tab@..@tab@@space@@tab@
cd
if not exist foobar (cd ..)
cd foobar
mkdir "bar bak" mkdir "bar bak"
cd "bar bak" cd "bar bak"
cd cd
cd .. cd ..
cd bar bak cd bar bak
cd cd
cd "bar bak@space@"@tab@@space@
cd
cd ..\.. cd ..\..
cd cd
rd /Q/s foobar rd /Q/s foobar
...@@ -282,7 +312,7 @@ echo bar> foobaz ...@@ -282,7 +312,7 @@ echo bar> foobaz
type foobaz type foobaz
echo *** echo ***
@echo off @echo off
type foobaz type foobaz@tab@
echo *** echo ***
del foobaz del foobaz
...@@ -296,7 +326,7 @@ dir /b /a-d ...@@ -296,7 +326,7 @@ dir /b /a-d
echo foo > nul echo foo > nul
dir /b /a-d dir /b /a-d
echo foo > NuL echo foo > NuL
dir /b /a-d @tab@dir /b@tab@/a-d
del bar del bar
rem NUL not special everywhere rem NUL not special everywhere
call :setError 123 call :setError 123
...@@ -351,6 +381,11 @@ for %%i in (A B C) do call :forTestFun1 %%i ...@@ -351,6 +381,11 @@ for %%i in (A B C) do call :forTestFun1 %%i
for %%i in (1,4,1) do echo %%i for %%i in (1,4,1) do echo %%i
for %%i in (A, B,C) do echo %%i for %%i in (A, B,C) do echo %%i
for %%i in (X) do echo %%i for %%i in (X) do echo %%i
for@tab@%%i in (X2) do echo %%i
for %%i in@tab@(X3) do echo %%i
for %%i in (@tab@ foo@tab@) do echo %%i
for@tab@ %%i in@tab@(@tab@M) do echo %%i
for %%i@tab@in (X)@tab@do@tab@echo %%i
goto :endForTestFun1 goto :endForTestFun1
:forTestFun1 :forTestFun1
echo %1 echo %1
......
...@@ -47,6 +47,30 @@ word@space@ ...@@ -47,6 +47,30 @@ word@space@
@pwd@>echo word@space@@space@@space@ @pwd@>echo word@space@@space@@space@
word@space@@space@ word@space@@space@
@todo_wine@@pwd@>echo word@space@
word
@pwd@>echo@tab@word@space@
@todo_wine@word
@pwd@>echo@tab@word@space@@tab@@space@
@todo_wine@word@space@@tab@
@pwd@>echo@tab@word@tab@@space@@space@
@todo_wine@word@tab@@space@
@todo_wine@@pwd@>echo word@space@
word
@pwd@>echo@space@@tab@word@space@
@tab@word
@pwd@>echo@space@@space@@tab@word@space@
@space@@tab@word
@pwd@>echo@tab@@tab@word@space@
@todo_wine@@tab@word
------------ Testing 'echo' [OFF] -------------- ------------ Testing 'echo' [OFF] --------------
word word
'singlequotedword' 'singlequotedword'
...@@ -63,6 +87,14 @@ word ...@@ -63,6 +87,14 @@ word
:word :word
word@space@ word@space@
word@space@@space@ word@space@@space@
word
@todo_wine@word
@todo_wine@word@space@@tab@
@todo_wine@word@tab@@space@
word
@tab@word
@space@@tab@word
@todo_wine@@tab@word
------------ Testing redirection operators -------------- ------------ Testing redirection operators --------------
...stdout redirection ...stdout redirection
foo foo
...@@ -126,6 +158,10 @@ BAZ=bazbaz ...@@ -126,6 +158,10 @@ BAZ=bazbaz
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
@todo_wine@foo
@todo_wine@''
'foo@space@'
'foo@tab@'
------------ Testing variable expansion -------------- ------------ Testing variable expansion --------------
~dp0 should be directory containing batch file ~dp0 should be directory containing batch file
@pwd@\ @pwd@\
...@@ -189,6 +225,8 @@ Current dir: @pwd@\foobar@or_broken@Current dir:@space@ ...@@ -189,6 +225,8 @@ Current dir: @pwd@\foobar@or_broken@Current dir:@space@
@pwd@\foobar @pwd@\foobar
@pwd@ @pwd@
@todo_wine@@pwd@ @todo_wine@@pwd@
@todo_wine@@pwd@
@pwd@\foobar\bar bak
@pwd@\foobar\bar bak @pwd@\foobar\bar bak
@pwd@\foobar\bar bak @pwd@\foobar\bar bak
@pwd@ @pwd@
...@@ -237,6 +275,11 @@ A ...@@ -237,6 +275,11 @@ A
B B
C C
X X
@todo_wine@X2
@todo_wine@X3
foo
@todo_wine@M
@todo_wine@X
...imbricated FORs ...imbricated FORs
@todo_wine@X Y @todo_wine@X Y
@todo_wine@X Y @todo_wine@X Y
......
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