cmd/tests: Add tests for EQU comparison operator in "if" statements.

This commit is contained in:
Frédéric Delanoy 2012-10-23 03:10:25 +02:00 committed by Alexandre Julliard
parent ac52924d44
commit a0a61cb592
2 changed files with 31 additions and 0 deletions

View File

@ -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=

View File

@ -481,6 +481,12 @@ LSS string can be used as operand for LSS comparison
@todo_wine@a LEQ B insensitive
@todo_wine@A LEQ b
@todo_wine@A LEQ b insensitive
@todo_wine@A EQU A
@todo_wine@B EQU B
@todo_wine@AB EQU AB
@todo_wine@BA EQU BA
@todo_wine@AA EQU AA
@todo_wine@A EQU a insensitive
------ for numbers
negative numbers handled
negative numbers handled
@ -505,6 +511,14 @@ also in negative form
@todo_wine@0 LEQ 9
@todo_wine@1 LEQ 9
@todo_wine@9 LEQ 9
@todo_wine@0 EQU 0
@todo_wine@1 EQU 1
@todo_wine@10 EQU 10
@todo_wine@9 EQU 9
@todo_wine@octal ok
@todo_wine@hexa ok
@todo_wine@string/hexa compare ok
@todo_wine@string/hexa compare ok
------------ Testing for ------------
--- plain FOR
A