[7/7] cmd/tests: Add tests for mixed number/stringified numbers comparisons in "if" statements
Frédéric Delanoy
frederic.delanoy at gmail.com
Mon Oct 22 20:10:29 CDT 2012
---
programs/cmd/tests/test_builtins.cmd | 19 +++++++++++++++++++
programs/cmd/tests/test_builtins.cmd.exp | 17 +++++++++++++++++
2 files changed, 36 insertions(+)
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
--
1.7.11.3
More information about the wine-patches
mailing list