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

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

View file

@ -694,6 +694,11 @@ 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
for %%i in (%STR_PARMS%) do call :NEQtest %%i A
for %%i in (%STR_PARMS%) do call :NEQtest %%i B
for %%i in (%STR_PARMS%) do call :NEQtest %%i AB
for %%i in (%STR_PARMS%) do call :NEQtest %%i BA
for %%i in (%STR_PARMS%) do call :NEQtest %%i AA
echo ------ for numbers
if -1 LSS 1 (echo negative numbers handled)
if not -1 LSS -10 (echo negative numbers handled)
@ -719,6 +724,10 @@ 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)
for %%i in (%INT_PARMS%) do call :NEQtest %%i 0
for %%i in (%INT_PARMS%) do call :NEQtest %%i 1
for %%i in (%INT_PARMS%) do call :NEQtest %%i 10
for %%i in (%INT_PARMS%) do call :NEQtest %%i 9
goto :endIfCompOpsSubroutines
rem IF subroutines helpers
@ -731,6 +740,9 @@ goto :eof
:EQUtest
if %1 EQU %2 echo %1 EQU %2
goto :eof
:NEQtest
if %1 NEQ %2 echo %1 NEQ %2
goto :eof
:endIfCompOpsSubroutines
set STR_PARMS=

View file

@ -487,6 +487,26 @@ LSS string can be used as operand for LSS comparison
@todo_wine@BA EQU BA
@todo_wine@AA EQU AA
@todo_wine@A EQU a insensitive
@todo_wine@B NEQ A
@todo_wine@AB NEQ A
@todo_wine@BA NEQ A
@todo_wine@AA NEQ A
@todo_wine@A NEQ B
@todo_wine@AB NEQ B
@todo_wine@BA NEQ B
@todo_wine@AA NEQ B
@todo_wine@A NEQ AB
@todo_wine@B NEQ AB
@todo_wine@BA NEQ AB
@todo_wine@AA NEQ AB
@todo_wine@A NEQ BA
@todo_wine@B NEQ BA
@todo_wine@AB NEQ BA
@todo_wine@AA NEQ BA
@todo_wine@A NEQ AA
@todo_wine@B NEQ AA
@todo_wine@AB NEQ AA
@todo_wine@BA NEQ AA
------ for numbers
negative numbers handled
negative numbers handled
@ -519,6 +539,18 @@ also in negative form
@todo_wine@hexa ok
@todo_wine@string/hexa compare ok
@todo_wine@string/hexa compare ok
@todo_wine@1 NEQ 0
@todo_wine@10 NEQ 0
@todo_wine@9 NEQ 0
@todo_wine@0 NEQ 1
@todo_wine@10 NEQ 1
@todo_wine@9 NEQ 1
@todo_wine@0 NEQ 10
@todo_wine@1 NEQ 10
@todo_wine@9 NEQ 10
@todo_wine@0 NEQ 9
@todo_wine@1 NEQ 9
@todo_wine@10 NEQ 9
------------ Testing for ------------
--- plain FOR
A