cmd/tests: Add basic FOR /F tests.

This commit is contained in:
Frédéric Delanoy 2011-08-25 23:08:32 +02:00 committed by Alexandre Julliard
parent 199f788c31
commit bf0e1c7ca7
2 changed files with 78 additions and 0 deletions

View File

@ -585,6 +585,54 @@ set /a var=foo=19, foo %%= 4 + (bar %%= 7) & echo.
set foo=
set bar=
set var=
echo ...for /F
mkdir foobar & cd foobar
echo ......string argument
for /F %%i in ("a b c") do echo %%i
for /f %%i in ("a ") do echo %%i
for /f %%i in ("a") do echo %%i
fOr /f %%i in (" a") do echo %%i
for /f %%i in (" a ") do echo %%i
echo ......fileset argument
echo .........basic blank handling
echo a b c>foo
for /f %%i in (foo) do echo %%i
echo a >foo
for /f %%i in (foo) do echo %%i
echo a>foo
for /f %%i in (foo) do echo %%i
echo a>foo
for /f %%i in (foo) do echo %%i
echo a >foo
for /f %%i in (foo) do echo %%i
echo. > foo
for /f %%i in (foo) do echo %%i
echo. >> foo
echo b > foo
for /f %%i in (foo) do echo %%i
echo .........multi-line with empty lines
echo a Z f> foo
echo. >> foo
echo.>> foo
echo b bC>> foo
echo c>> foo
echo. >> foo
for /f %%b in (foo) do echo %%b
echo .........multiple files
echo q w > bar
echo.>> bar
echo kkk>>bar
for /f %%k in (foo bar) do echo %%k
for /f %%k in (bar foo) do echo %%k
rem echo ......command argument
rem Not implemented on NT4
rem FIXME: Not testable right now in wine: not implemented and would need
rem preliminary grep-like program implementation (e.g. like findstr or fc) even
rem for a simple todo_wine test
rem (for /f "usebackq" %%i in (`echo z a b`) do echo %%i) || echo not supported
rem (for /f usebackq %%i in (`echo z a b`) do echo %%i) || echo not supported
cd ..
rd /s/q foobar
echo -----------Testing del /a-----------
del /f/q *.test > nul

View File

@ -431,6 +431,36 @@ bar
0
@todo_wine@5@or_broken@0
...for /F
......string argument
a
a
a
a
a
......fileset argument
.........basic blank handling
a
a
a
a
a
b
.........multi-line with empty lines
a
b
c
.........multiple files
a
b
c
q
kkk
q
kkk
a
b
c
-----------Testing del /a-----------
not-r.test not found after delete, good
r.test found before delete, good