Bug #55582 mtr root detection (and if-expression execution) broken

if() treated any non-numeric string as false
Fixed to treat those as true instead
Added some test cases
Fixed missing $ in variable name in include/mix2.inc
This commit is contained in:
Bjorn Munch 2010-08-03 16:11:23 +02:00
commit 5e92df6e0e
4 changed files with 39 additions and 3 deletions

View file

@ -1105,6 +1105,25 @@ if (!$counter)
echo Counter is not 0, (counter=0);
}
# ----------------------------------------------------------------------------
# Test if with some non-numerics
# ----------------------------------------------------------------------------
let $counter=alpha;
if ($counter)
{
echo Counter is true, (counter=alpha);
}
let $counter= ;
if ($counter)
{
echo oops, space is true;
}
if (beta)
{
echo Beta is true;
}
# ----------------------------------------------------------------------------
# Test while, { and }
# ----------------------------------------------------------------------------