cmd/tests: Add tests for mixed number/stringified numbers comparisons in "if" statements.

This commit is contained in:
Frédéric Delanoy 2012-10-23 03:10:29 +02:00 committed by Alexandre Julliard
parent 5888ad3537
commit c5faceabd2
2 changed files with 36 additions and 0 deletions

View File

@ -746,6 +746,25 @@ for %%i in (%INT_PARMS%) do call :GTRtest %%i 0
for %%i in (%INT_PARMS%) do call :GTRtest %%i 1
for %%i in (%INT_PARMS%) do call :GTRtest %%i 10
for %%i in (%INT_PARMS%) do call :GTRtest %%i 9
echo ------ for numbers and stringified numbers
if not "1" EQU 1 (echo strings and integers not equal) else echo foo
if not 1 EQU "1" (echo strings and integers not equal) else echo foo
if '1' EQU 1 echo '1' EQU 1
if 1 EQU '1' echo 1 EQU '1'
if not "1" GEQ 1 (echo foo) else echo bar
if "10" GEQ "1" echo "10" GEQ "1"
if '1' GEQ 1 (echo '1' GEQ 1) else echo NT4
if 1 GEQ "1" echo 1 GEQ "1"
if "1" GEQ "1" echo "1" GEQ "1"
if '1' GEQ "1" echo '1' GEQ "1"
if "10" GEQ "1" echo "10" GEQ "1"
if not 1 GEQ '1' (echo non NT4) else echo 1 GEQ '1'
for %%i in ("1" '1') do call :GEQtest %%i '1'
if "10" GEQ '1' (echo "10" GEQ '1') else echo foo
if 1 GEQ "10" (echo 1 GEQ "10") else echo foo
if "1" GEQ "10" (echo 1 GEQ "10") else echo foo
if '1' GEQ "10" (echo '1' GEQ "10") else echo foo
if "10" GEQ "10" (echo "10" GEQ "10")
goto :endIfCompOpsSubroutines
rem IF subroutines helpers

View File

@ -592,6 +592,23 @@ also in negative form
@todo_wine@10 GTR 1
@todo_wine@9 GTR 1
@todo_wine@10 GTR 9
------ for numbers and stringified numbers
strings and integers not equal
strings and integers not equal
foo
@todo_wine@"10" GEQ "1"
@todo_wine@'1' GEQ 1@or_broken@NT4
@todo_wine@1 GEQ "1"
@todo_wine@"1" GEQ "1"
@todo_wine@'1' GEQ "1"
@todo_wine@"10" GEQ "1"
@todo_wine@non NT4@or_broken@1 GEQ '1'
@todo_wine@'1' GEQ '1'
@todo_wine@foo
@todo_wine@1 GEQ "10"
@todo_wine@foo
@todo_wine@'1' GEQ "10"
@todo_wine@"10" GEQ "10"
------------ Testing for ------------
--- plain FOR
A