From 5888ad35377d30683a30723e3975835474527a63 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Delanoy?= Date: Tue, 23 Oct 2012 03:10:28 +0200 Subject: [PATCH] cmd/tests: Add tests for GTR comparison operator in "if" statements. --- programs/cmd/tests/test_builtins.cmd | 12 ++++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index b7e72eca757..42560560934 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -704,6 +704,11 @@ 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 +for %%i in (%STR_PARMS%) do call :GTRtest %%i A +for %%i in (%STR_PARMS%) do call :GTRtest %%i B +for %%i in (%STR_PARMS%) do call :GTRtest %%i AB +for %%i in (%STR_PARMS%) do call :GTRtest %%i BA +for %%i in (%STR_PARMS%) do call :GTRtest %%i AA echo ------ for numbers if -1 LSS 1 (echo negative numbers handled) if not -1 LSS -10 (echo negative numbers handled) @@ -737,6 +742,10 @@ 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 +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 goto :endIfCompOpsSubroutines rem IF subroutines helpers @@ -755,6 +764,9 @@ goto :eof :GEQtest if %1 GEQ %2 echo %1 GEQ %2 goto :eof +:GTRtest +if %1 GTR %2 echo %1 GTR %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 81686ffef6e..6c1825e196c 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -522,6 +522,16 @@ LSS string can be used as operand for LSS comparison @todo_wine@AB GEQ AA @todo_wine@BA GEQ AA @todo_wine@AA GEQ AA +@todo_wine@B GTR A +@todo_wine@AB GTR A +@todo_wine@BA GTR A +@todo_wine@AA GTR A +@todo_wine@BA GTR B +@todo_wine@B GTR AB +@todo_wine@BA GTR AB +@todo_wine@B GTR AA +@todo_wine@AB GTR AA +@todo_wine@BA GTR AA ------ for numbers negative numbers handled negative numbers handled @@ -576,6 +586,12 @@ also in negative form @todo_wine@10 GEQ 10 @todo_wine@10 GEQ 9 @todo_wine@9 GEQ 9 +@todo_wine@1 GTR 0 +@todo_wine@10 GTR 0 +@todo_wine@9 GTR 0 +@todo_wine@10 GTR 1 +@todo_wine@9 GTR 1 +@todo_wine@10 GTR 9 ------------ Testing for ------------ --- plain FOR A -- 2.11.4.GIT