[7/7] cmd/tests: Add tests for mixed number / stringified numbers comparisons in if statements (try 4)

Frédéric Delanoy frederic.delanoy at gmail.com
Sat Sep 17 03:54:44 CDT 2011


---
 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 a339b3c..6d3d56b 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -685,6 +685,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 59c35f1..6931ecd 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -550,6 +550,23 @@ hexa ok
 10 GTR 1
 9 GTR 1
 10 GTR 9
+...... for numbers and stringified numbers ......
+strings and integers not equal
+strings and integers not equal
+foo
+"10" GEQ "1"
+'1' GEQ 1 at or_broken@NT4
+1 GEQ "1"
+"1" GEQ "1"
+'1' GEQ "1"
+"10" GEQ "1"
+non NT4 at or_broken@1 GEQ '1'
+'1' GEQ '1'
+foo
+1 GEQ "10"
+foo
+'1' GEQ "10"
+"10" GEQ "10"
 -----------Testing for -----------
 ...plain FOR
 A
-- 
1.7.6.3




More information about the wine-patches mailing list