[7/7] cmd/tests: Add tests for mixed number / stringified numbers comparisons in if statements
Frédéric Delanoy
frederic.delanoy at gmail.com
Thu Sep 1 06:02:25 CDT 2011
---
programs/cmd/tests/test_builtins.cmd | 16 ++++++++++++++++
programs/cmd/tests/test_builtins.cmd.exp | 17 +++++++++++++++++
2 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 38aa555..c27e76f 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -660,6 +660,22 @@ 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 ... comparison operators 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
+for %%i in (1 "1" '1' "10") do call :GEQtest %%i "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 20104aa..d470cf7 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -531,6 +531,23 @@ BA GTR AA
10 GTR 1
9 GTR 1
10 GTR 9
+... comparison operators for numbers and stringified numbers
+ at todo_wine@strings and integers not equal
+ at todo_wine@strings and integers not equal
+ at todo_wine@foo
+"10" GEQ "1"
+'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"
+non NT4 at or_broken@1 GEQ '1'
+'1' GEQ '1'
+ at todo_wine@foo
+ at todo_wine@1 GEQ "10"
+foo
+ at todo_wine@'1' GEQ "10"
+"10" GEQ "10"
-----------Testing for -----------
...plain FOR
A
--
1.7.6
More information about the wine-patches
mailing list