[PATCH 10/10] cmd/tests: Add tests for tab handling
Frédéric Delanoy
frederic.delanoy at gmail.com
Fri Aug 19 11:41:58 CDT 2011
---
programs/cmd/tests/test_builtins.cmd | 40 ++++++++++++++++++++++++++-
programs/cmd/tests/test_builtins.cmd.exp | 43 ++++++++++++++++++++++++++++++
2 files changed, 81 insertions(+), 2 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index c640ec4..7193bf1 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -17,6 +17,14 @@ echo:word
echo :word
echo word at space@
echo word at space@@space@
+ echo word
+echo at tab@word
+echo at tab@word @tab@
+echo at tab@word at tab@@space@
+ at tab@echo word
+echo @tab at word
+echo @tab at word
+echo at tab@@tab at word
@echo off
echo ------------ Testing 'echo' [OFF] --------------
@@ -35,6 +43,14 @@ echo:word
echo :word
echo word at space@
echo word at space@@space@
+ echo word
+echo at tab@word
+echo at tab@word @tab@
+echo at tab@word at tab@@space@
+ at tab@echo word
+echo @tab at word
+echo @tab at word
+echo at tab@@tab at 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 at tab@FOO=foo
+echo %FOO%
+set at tab@FOO=
+echo '%FOO%'
+set FOO=foo at space@
+echo '%FOO%'
+set FOO=foo at tab@
+echo '%FOO%'
set FOO=
echo ------------ Testing variable expansion --------------
@@ -266,12 +290,18 @@ cd.. at space@
cd
if not exist foobar (cd ..)
cd foobar
+cd at tab@.. at 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 at 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 at 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
+ at tab@dir /b at 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 at tab@%%i in (X2) do echo %%i
+for %%i in at tab@(X3) do echo %%i
+for %%i in (@tab@ foo at tab@) do echo %%i
+for at tab@ %%i in at tab@(@tab at M) do echo %%i
+for %%i at tab@in (X)@tab at do@tab at echo %%i
goto :endForTestFun1
:forTestFun1
echo %1
@@ -402,6 +437,7 @@ rd /s/Q foobar
echo ...for /L
rem Some cases loop forever writing 0s, like e.g. (1,0,1), (1,a,3) or (a,b,c); those can't be tested here
for /L %%i in (1,2,0) do echo %%i
+for at tab@/L %%i in (1,2,0) do echo %%i
for /L %%i in (1,2,6) do echo %%i
for /l %%i in (1 ,2,6) do echo %%i
for /L %%i in (a,2,3) do echo %%i
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 1580637..18ba102 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -47,6 +47,30 @@ word at space@
@pwd@>echo word at space@@space@@space@
word at space@@space@
+
+ at todo_wine@@pwd@>echo word at space@
+word
+
+ at pwd@>echo at tab@word at space@
+ at todo_wine@word
+
+ at pwd@>echo at tab@word at space@@tab@@space@
+ at todo_wine@word at space@@tab@
+
+ at pwd@>echo at tab@word at tab@@space@@space@
+ at todo_wine@word at tab@@space@
+
+ at todo_wine@@pwd@>echo word at space@
+word
+
+ at pwd@>echo at space@@tab at word@space@
+ at tab@word
+
+ at pwd@>echo at space@@space@@tab at word@space@
+ at space@@tab at word
+
+ at pwd@>echo at tab@@tab at word@space@
+ at todo_wine@@tab at word
------------ Testing 'echo' [OFF] --------------
word
'singlequotedword'
@@ -63,6 +87,14 @@ word
:word
word at space@
word at space@@space@
+word
+ at todo_wine@word
+ at todo_wine@word at space@@tab@
+ at todo_wine@word at tab@@space@
+word
+ at tab@word
+ at space@@tab at word
+ at todo_wine@@tab at 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
+ at todo_wine@foo
+ at todo_wine@''
+'foo at space@'
+'foo at tab@'
------------ Testing variable expansion --------------
~dp0 should be directory containing batch file
@pwd@\
@@ -189,6 +225,8 @@ Current dir: @pwd@\foobar at or_broken@Current dir:@space@
@pwd@\foobar
@pwd@
@todo_wine@@pwd@
+ at todo_wine@@pwd@
+ at pwd@\foobar\bar bak
@pwd@\foobar\bar bak
@pwd@\foobar\bar bak
@pwd@
@@ -237,6 +275,11 @@ A
B
C
X
+ at todo_wine@X2
+ at todo_wine@X3
+foo
+ at todo_wine@M
+ at todo_wine@X
...imbricated FORs
@todo_wine at X Y
@todo_wine at X Y
--
1.7.6
More information about the wine-patches
mailing list