From 43f5471cbaadc4655a363da351712e24b88eb94e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delanoy?= Date: Tue, 23 Oct 2012 03:10:27 +0200 Subject: [PATCH] cmd/tests: Add tests for GEQ comparison operator in "if" statements. --- programs/cmd/tests/test_builtins.cmd | 12 ++++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 25 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index e940b2d6a02..b7e72eca757 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -699,6 +699,11 @@ 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 +for %%i in (%STR_PARMS%) do call :GEQtest %%i A +for %%i in (%STR_PARMS%) do call :GEQtest %%i B +for %%i in (%STR_PARMS%) do call :GEQtest %%i AB +for %%i in (%STR_PARMS%) do call :GEQtest %%i BA +for %%i in (%STR_PARMS%) do call :GEQtest %%i AA echo ------ for numbers if -1 LSS 1 (echo negative numbers handled) if not -1 LSS -10 (echo negative numbers handled) @@ -728,6 +733,10 @@ 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 +for %%i in (%INT_PARMS%) do call :GEQtest %%i 0 +for %%i in (%INT_PARMS%) do call :GEQtest %%i 1 +for %%i in (%INT_PARMS%) do call :GEQtest %%i 10 +for %%i in (%INT_PARMS%) do call :GEQtest %%i 9 goto :endIfCompOpsSubroutines rem IF subroutines helpers @@ -743,6 +752,9 @@ goto :eof :NEQtest if %1 NEQ %2 echo %1 NEQ %2 goto :eof +:GEQtest +if %1 GEQ %2 echo %1 GEQ %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 c04c7753214..81686ffef6e 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -507,6 +507,21 @@ LSS string can be used as operand for LSS comparison @todo_wine@B NEQ AA @todo_wine@AB NEQ AA @todo_wine@BA NEQ AA +@todo_wine@A GEQ A +@todo_wine@B GEQ A +@todo_wine@AB GEQ A +@todo_wine@BA GEQ A +@todo_wine@AA GEQ A +@todo_wine@B GEQ B +@todo_wine@BA GEQ B +@todo_wine@B GEQ AB +@todo_wine@AB GEQ AB +@todo_wine@BA GEQ AB +@todo_wine@BA GEQ BA +@todo_wine@B GEQ AA +@todo_wine@AB GEQ AA +@todo_wine@BA GEQ AA +@todo_wine@AA GEQ AA ------ for numbers negative numbers handled negative numbers handled @@ -551,6 +566,16 @@ also in negative form @todo_wine@0 NEQ 9 @todo_wine@1 NEQ 9 @todo_wine@10 NEQ 9 +@todo_wine@0 GEQ 0 +@todo_wine@1 GEQ 0 +@todo_wine@10 GEQ 0 +@todo_wine@9 GEQ 0 +@todo_wine@1 GEQ 1 +@todo_wine@10 GEQ 1 +@todo_wine@9 GEQ 1 +@todo_wine@10 GEQ 10 +@todo_wine@10 GEQ 9 +@todo_wine@9 GEQ 9 ------------ Testing for ------------ --- plain FOR A