If input is only string '0', then loop condition is false and
loop body is not evaluated. This loop should test whether $_
is empty string, not $_ is false.
Output of #111 is
% perl -MText::Xslate -E '$t=Text::Xslate->new; $t->render_string("1") eq "1" ? say "OK" : say "ERR"'
OK
% perl -MText::Xslate -E '$t=Text::Xslate->new; $t->render_string("0") eq "0" ? say "OK" : say "ERR"'
OK
If input is only string '0', then loop condition is false and loop body is not evaluated. This loop should test whether
$_
is empty string, not$_
is false.Output of #111 is
This fix is related to #111, #112.
Please see this patch.