=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: cmd/tests: Add tests for EQU comparison operator in "if" statements.
Alexandre Julliard
julliard at winehq.org
Tue Oct 23 13:37:17 CDT 2012
Module: wine
Branch: master
Commit: a0a61cb59200c9147be700f6051d0365640dec01
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a0a61cb59200c9147be700f6051d0365640dec01
Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date: Tue Oct 23 03:10:25 2012 +0200
cmd/tests: Add tests for EQU comparison operator in "if" statements.
---
programs/cmd/tests/test_builtins.cmd | 17 +++++++++++++++++
programs/cmd/tests/test_builtins.cmd.exp | 14 ++++++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 28721c1..7c83393 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -688,6 +688,12 @@ if a LEQ B (echo a LEQ B) else echo NT4
if /I a LEQ B echo a LEQ B insensitive
if A LEQ b echo A LEQ b
if /I A LEQ b echo A LEQ b insensitive
+for %%i in (%STR_PARMS%) do call :EQUtest %%i A
+for %%i in (%STR_PARMS%) do call :EQUtest %%i B
+for %%i in (%STR_PARMS%) do call :EQUtest %%i AB
+for %%i in (%STR_PARMS%) do call :EQUtest %%i BA
+for %%i in (%STR_PARMS%) do call :EQUtest %%i AA
+if /I A EQU a echo A EQU a insensitive
echo ------ for numbers
if -1 LSS 1 (echo negative numbers handled)
if not -1 LSS -10 (echo negative numbers handled)
@@ -705,6 +711,14 @@ for %%i in (%INT_PARMS%) do call :LEQtest %%i 0
for %%i in (%INT_PARMS%) do call :LEQtest %%i 1
for %%i in (%INT_PARMS%) do call :LEQtest %%i 10
for %%i in (%INT_PARMS%) do call :LEQtest %%i 9
+for %%i in (%INT_PARMS%) do call :EQUtest %%i 0
+for %%i in (%INT_PARMS%) do call :EQUtest %%i 1
+for %%i in (%INT_PARMS%) do call :EQUtest %%i 10
+for %%i in (%INT_PARMS%) do call :EQUtest %%i 9
+if 011 EQU 9 (echo octal ok)
+if 0xA1 EQU 161 (echo hexa ok)
+if 0xA1 EQU "161" (echo hexa should be be recognized) else (echo string/hexa compare ok)
+if "0xA1" EQU 161 (echo hexa should be be recognized) else (echo string/hexa compare ok)
goto :endIfCompOpsSubroutines
rem IF subroutines helpers
@@ -714,6 +728,9 @@ goto :eof
:LEQtest
if %1 LEQ %2 echo %1 LEQ %2
goto :eof
+:EQUtest
+if %1 EQU %2 echo %1 EQU %2
+goto :eof
:endIfCompOpsSubroutines
set STR_PARMS=
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 53eaffd..91ad55b 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -481,6 +481,12 @@ LSS string can be used as operand for LSS comparison
@todo_wine at a LEQ B insensitive
@todo_wine at A LEQ b
@todo_wine at A LEQ b insensitive
+ at todo_wine@A EQU A
+ at todo_wine@B EQU B
+ at todo_wine@AB EQU AB
+ at todo_wine@BA EQU BA
+ at todo_wine@AA EQU AA
+ at todo_wine@A EQU a insensitive
------ for numbers
negative numbers handled
negative numbers handled
@@ -505,6 +511,14 @@ also in negative form
@todo_wine at 0 LEQ 9
@todo_wine at 1 LEQ 9
@todo_wine at 9 LEQ 9
+ at todo_wine@0 EQU 0
+ at todo_wine@1 EQU 1
+ at todo_wine@10 EQU 10
+ at todo_wine@9 EQU 9
+ at todo_wine@octal ok
+ at todo_wine@hexa ok
+ at todo_wine@string/hexa compare ok
+ at todo_wine@string/hexa compare ok
------------ Testing for ------------
--- plain FOR
A
More information about the wine-cvs
mailing list