[3/7] cmd/tests: Add tests for EQU comparison operator in "if" statements

Frédéric Delanoy frederic.delanoy at gmail.com
Mon Oct 22 20:10:25 CDT 2012


---
 programs/cmd/tests/test_builtins.cmd     | 17 +++++++++++++++++
 programs/cmd/tests/test_builtins.cmd.exp | 14 ++++++++++++++
 2 files changed, 31 insertions(+)

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
-- 
1.7.11.3




More information about the wine-patches mailing list