[4/7] cmd/tests: Add tests for NEQ comparison operator in "if" statements

Frédéric Delanoy frederic.delanoy at gmail.com
Mon Oct 22 20:10:26 CDT 2012


---
 programs/cmd/tests/test_builtins.cmd     | 12 ++++++++++++
 programs/cmd/tests/test_builtins.cmd.exp | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)

diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 7c83393..e940b2d 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -694,6 +694,11 @@ for %%i in (%STR_PARMS%) do call :EQUtest %%i AB
 for %%i in (%STR_PARMS%) do call :EQUtest %%i BA
 for %%i in (%STR_PARMS%) do call :EQUtest %%i AA
 if /I A EQU a echo A EQU a insensitive
+for %%i in (%STR_PARMS%) do call :NEQtest %%i A
+for %%i in (%STR_PARMS%) do call :NEQtest %%i B
+for %%i in (%STR_PARMS%) do call :NEQtest %%i AB
+for %%i in (%STR_PARMS%) do call :NEQtest %%i BA
+for %%i in (%STR_PARMS%) do call :NEQtest %%i AA
 echo ------ for numbers
 if -1 LSS 1 (echo negative numbers handled)
 if not -1 LSS -10 (echo negative numbers handled)
@@ -719,6 +724,10 @@ if 011 EQU 9 (echo octal ok)
 if 0xA1 EQU 161 (echo hexa ok)
 if 0xA1 EQU "161" (echo hexa should be be recognized) else (echo string/hexa compare ok)
 if "0xA1" EQU 161 (echo hexa should be be recognized) else (echo string/hexa compare ok)
+for %%i in (%INT_PARMS%) do call :NEQtest %%i 0
+for %%i in (%INT_PARMS%) do call :NEQtest %%i 1
+for %%i in (%INT_PARMS%) do call :NEQtest %%i 10
+for %%i in (%INT_PARMS%) do call :NEQtest %%i 9
 goto :endIfCompOpsSubroutines
 
 rem IF subroutines helpers
@@ -731,6 +740,9 @@ goto :eof
 :EQUtest
 if %1 EQU %2 echo %1 EQU %2
 goto :eof
+:NEQtest
+if %1 NEQ %2 echo %1 NEQ %2
+goto :eof
 
 :endIfCompOpsSubroutines
 set STR_PARMS=
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 91ad55b..c04c775 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -487,6 +487,26 @@ LSS string can be used as operand for LSS comparison
 @todo_wine at BA EQU BA
 @todo_wine at AA EQU AA
 @todo_wine at A EQU a insensitive
+ at todo_wine@B NEQ A
+ at todo_wine@AB NEQ A
+ at todo_wine@BA NEQ A
+ at todo_wine@AA NEQ A
+ at todo_wine@A NEQ B
+ at todo_wine@AB NEQ B
+ at todo_wine@BA NEQ B
+ at todo_wine@AA NEQ B
+ at todo_wine@A NEQ AB
+ at todo_wine@B NEQ AB
+ at todo_wine@BA NEQ AB
+ at todo_wine@AA NEQ AB
+ at todo_wine@A NEQ BA
+ at todo_wine@B NEQ BA
+ at todo_wine@AB NEQ BA
+ at todo_wine@AA NEQ BA
+ at todo_wine@A NEQ AA
+ at todo_wine@B NEQ AA
+ at todo_wine@AB NEQ AA
+ at todo_wine@BA NEQ AA
 ------ for numbers
 negative numbers handled
 negative numbers handled
@@ -519,6 +539,18 @@ also in negative form
 @todo_wine at hexa ok
 @todo_wine at string/hexa compare ok
 @todo_wine at string/hexa compare ok
+ at todo_wine@1 NEQ 0
+ at todo_wine@10 NEQ 0
+ at todo_wine@9 NEQ 0
+ at todo_wine@0 NEQ 1
+ at todo_wine@10 NEQ 1
+ at todo_wine@9 NEQ 1
+ at todo_wine@0 NEQ 10
+ at todo_wine@1 NEQ 10
+ at todo_wine@9 NEQ 10
+ at todo_wine@0 NEQ 9
+ at todo_wine@1 NEQ 9
+ at todo_wine@10 NEQ 9
 ------------ Testing for ------------
 --- plain FOR
 A
-- 
1.7.11.3




More information about the wine-patches mailing list