From 636cb4e66cde3ddfbdc9be755d5a006889e1ba40 Mon Sep 17 00:00:00 2001 From: Royce Mitchell III Date: Mon, 19 Sep 2005 05:29:17 +0000 Subject: [PATCH] fixed mistakes, extra tests illustrating problems with if command svn path=/trunk/; revision=17926 --- reactos/subsys/system/cmd/seta_test.cmd | 69 ++++++++++++++----------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/reactos/subsys/system/cmd/seta_test.cmd b/reactos/subsys/system/cmd/seta_test.cmd index 044094d1118..fb2619f0ff6 100644 --- a/reactos/subsys/system/cmd/seta_test.cmd +++ b/reactos/subsys/system/cmd/seta_test.cmd @@ -1,60 +1,67 @@ @echo off -if ("1"=="2") goto failure -if !("1"=="1") goto failure +@rem the next line illustrates a bug in our cmd +set /a a=5%2 +@rem the next two lines illustrate bug in existing if code +if not "=="=="==" goto failure +if "=="=="==" goto next1 +goto failure +:next1 +if "1"=="2" goto failure +if !"1"=="1" goto failure set /a a=1 -if !("%a%"=="1") goto failure +if !"%a%"=="1" goto failure set /a b=a -if !("%b%"=="1") goto failure +if !"%b%"=="1" goto failure set /a a=!5 -if !("%a%"=="0") goto failure +if !"%a%"=="0" goto failure set /a a=~5 -if !("%a%"=="-6") goto failure +if !"%a%"=="-6" goto failure set /a a=5,a=-a -if !("%a%"=="-5") goto failure +if !"%a%"=="-5" goto failure set /a a=5*7 -if !("%a%"=="35") goto failure +if !"%a%"=="35" goto failure set /a a=2000/10 -if !("%a%"=="200") goto failure +if !"%a%"=="200" goto failure set /a a=42%9 -if !("%a%"=="6") goto failure +if !"%a%"=="6" goto failure set /a a=7+9 -if !("%a%"=="16") goto failure +if !"%a%"=="16" goto failure set /a a=9-7 -if !("%a%"=="2") goto failure +if !"%a%"=="2" goto failure set /a a=9^<^<2 -if !("%a%"=="36") goto failure +if !"%a%"=="36" goto failure set /a a=36^>^>2 -if !("%a%"=="9") goto failure +if !"%a%"=="9" goto failure set /a a=42^&9 -if !("%a%"=="8") goto failure +if !"%a%"=="8" goto failure set /a a=32^^9 -if !("%a%"=="41") goto failure +if !"%a%"=="41" goto failure set /a a=10^|22 -if !("%a%"=="30") goto failure +if !"%a%"=="30" goto failure set /a a=2,a*=3 -if !("%a%"=="6") goto failure +if !"%a%"=="6" goto failure set /a a=11,a/=2 -if !("%a%"=="5") goto failure +if !"%a%"=="5" goto failure set /a a=42,a%=9 -if !("%a%"=="6") goto failure +if !"%a%"=="6" goto failure set /a a=7,a+=9 -if !("%a%"=="16") goto failure +if !"%a%"=="16" goto failure set /a a=9,a-=7 -if !("%a%"=="2") goto failure +if !"%a%"=="2" goto failure set /a a=42,a^&=9 -if !("%a%"=="8") goto failure +if !"%a%"=="8" goto failure set /a a=32,a^^=9 -if !("%a%"=="41") goto failure +if !"%a%"=="41" goto failure set /a a=10,a^|=22 -if !("%a%"=="30") goto failure +if !"%a%"=="30" goto failure set /a a=9,a^<^<=2 -if !("%a%"=="36") goto failure +if !"%a%"=="36" goto failure set /a a=36,a^>^>=2 -if !("%a%"=="9") goto failure -set /a a=(1,2) -if !("%a%"=="2") goto failure +if !"%a%"=="9" goto failure +set /a a=1,2 +if !"%a%"=="2" goto failure set /a a=(a=1,a+2) -if ("%a%"=="3") goto success +if "%a%"=="3" goto success goto failure :success @@ -62,6 +69,6 @@ echo SUCCESS! goto done :failure -echo FAILURE! (remove the echo off and see the last formula that executed before this line) +echo FAILURE! remove the echo off and see the last formula that executed before this line :done