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