Acme-AlgebraicToRPN
view release on metacpan or search on metacpan
lib/Acme/AlgebraicToRPN.pm view on Meta::CPAN
if defined $r && !($r =~ /$RE{balanced}{-parens=>'()'}/);
}
}
=head2 B<check>
$ok = $al->check(\@stack, @expected);
Checks result of RPN conversion. @stack is what the B<rpn> function
returned, and @expected is what you expected the result to be. This
is kind of a diagnostic routine for testing.
Returns 1 if both @stack and @expected were the same, 0 if not.
=cut
sub check {
my ($self, $ref, @result) = @_;
my @shouldbe = @$ref;
return 0 unless @shouldbe == @result;
my $same = 1;
( run in 2.607 seconds using v1.01-cache-2.11-cpan-98e64b0badf )