=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: cmd/tests: Add tests for mixed number/stringified numbers comparisons in "if" statements.

Alexandre Julliard julliard at winehq.org
Tue Oct 23 13:37:18 CDT 2012


Module: wine
Branch: master
Commit: c5faceabd23e7a8c20712b3bcbcd6d1753f13abe
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c5faceabd23e7a8c20712b3bcbcd6d1753f13abe

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Tue Oct 23 03:10:29 2012 +0200

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

---

 programs/cmd/tests/test_builtins.cmd     |   19 +++++++++++++++++++
 programs/cmd/tests/test_builtins.cmd.exp |   17 +++++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 4256056..d314336 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -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
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 6c1825e..020246a 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -592,6 +592,23 @@ also in negative form
 @todo_wine at 10 GTR 1
 @todo_wine at 9 GTR 1
 @todo_wine at 10 GTR 9
+------ for numbers and stringified numbers
+strings and integers not equal
+strings and integers not equal
+foo
+ at todo_wine@"10" GEQ "1"
+ at todo_wine@'1' GEQ 1 at or_broken@NT4
+ at todo_wine@1 GEQ "1"
+ at todo_wine@"1" GEQ "1"
+ at todo_wine@'1' GEQ "1"
+ at todo_wine@"10" GEQ "1"
+ at todo_wine@non NT4 at or_broken@1 GEQ '1'
+ at todo_wine@'1' GEQ '1'
+ at todo_wine@foo
+ at todo_wine@1 GEQ "10"
+ at todo_wine@foo
+ at todo_wine@'1' GEQ "10"
+ at todo_wine@"10" GEQ "10"
 ------------ Testing for ------------
 --- plain FOR
 A




More information about the wine-cvs mailing list