From 8e3227c82486d85ad248c5dccb84cde9e464dc6a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Delanoy?= Date: Tue, 23 Oct 2012 03:10:26 +0200 Subject: [PATCH] cmd/tests: Add tests for NEQ comparison operator in "if" statements. --- 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 7c8339396ff..e940b2d6a02 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 91ad55b77e0..c04c7753214 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@BA EQU BA @todo_wine@AA EQU AA @todo_wine@A EQU a insensitive +@todo_wine@B NEQ A +@todo_wine@AB NEQ A +@todo_wine@BA NEQ A +@todo_wine@AA NEQ A +@todo_wine@A NEQ B +@todo_wine@AB NEQ B +@todo_wine@BA NEQ B +@todo_wine@AA NEQ B +@todo_wine@A NEQ AB +@todo_wine@B NEQ AB +@todo_wine@BA NEQ AB +@todo_wine@AA NEQ AB +@todo_wine@A NEQ BA +@todo_wine@B NEQ BA +@todo_wine@AB NEQ BA +@todo_wine@AA NEQ BA +@todo_wine@A NEQ AA +@todo_wine@B NEQ AA +@todo_wine@AB NEQ AA +@todo_wine@BA NEQ AA ------ for numbers negative numbers handled negative numbers handled @@ -519,6 +539,18 @@ also in negative form @todo_wine@hexa ok @todo_wine@string/hexa compare ok @todo_wine@string/hexa compare ok +@todo_wine@1 NEQ 0 +@todo_wine@10 NEQ 0 +@todo_wine@9 NEQ 0 +@todo_wine@0 NEQ 1 +@todo_wine@10 NEQ 1 +@todo_wine@9 NEQ 1 +@todo_wine@0 NEQ 10 +@todo_wine@1 NEQ 10 +@todo_wine@9 NEQ 10 +@todo_wine@0 NEQ 9 +@todo_wine@1 NEQ 9 +@todo_wine@10 NEQ 9 ------------ Testing for ------------ --- plain FOR A -- 2.11.4.GIT