Frédéric Delanoy : cmd/tests: Add FOR /L tests.

Alexandre Julliard julliard at winehq.org
Fri Jul 29 12:37:03 CDT 2011


Module: wine
Branch: master
Commit: 7fb790f8a7e38c10d08da4847f455b3ecc31d688
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7fb790f8a7e38c10d08da4847f455b3ecc31d688

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Fri Jul 29 13:59:52 2011 +0200

cmd/tests: Add FOR /L tests.

---

 programs/cmd/tests/test_builtins.cmd     |   19 +++++++++++++++++++
 programs/cmd/tests/test_builtins.cmd.exp |   13 +++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 94ec6e0..f3b1fc5 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -317,6 +317,25 @@ rem sort < tmp
 rem del tmp
 cd ..
 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 /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
+for /L %%i in (1,2,-1) do echo %%i
+for /L %%i in (-4,-1,-1) do echo %%i
+for /L %%i in (1,-2,-2) do echo %%i
+for /L %%i in (1,2,a) do echo %%i
+echo ErrorLevel %ErrorLevel%
+for /L %%i in (1,a,b) do echo %%i
+echo ErrorLevel %ErrorLevel%
+rem FIXME: following test cases cannot be currently tested due to an inconsistent/buggy 'for /L' parsing.
+rem for /L %%i in (a,2,b) do echo %%i
+rem for /L %%i in (1,1,1) do echo %%i
+rem for /L %%i in (1,-2,-1) do echo %%i
+rem for /L %%i in (-1,-1,-1) do echo %%i
+rem for /L %%i in (1,2, 3) do echo %%i
 
 echo -----------Testing del /a-----------
 del /f/q *.test > nul
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 7abfb21..51239b0 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -220,6 +220,19 @@ bazbaz
 baz
 foo
 bar
+...for /L
+1
+3
+5
+1
+3
+5
+0
+2
+1
+-1
+ at todo_wine@ErrorLevel 0
+ at todo_wine@ErrorLevel 0
 -----------Testing del /a-----------
 not-r.test not found after delete, good
 r.test found before delete, good




More information about the wine-cvs mailing list