The Perl Toolchain Summit 2025 Needs You: You can help 🙏 Learn more

use strict;
# Test if the MEE->variables() list the correct variables
my @test = (
['a', 'a'],
['a^a', 'a'],
['a + b', 'a|b'],
['a * a + b', 'a|b'],
['2', ''],
);
plan tests => scalar @test;
my $m = Math::Expression::Evaluator->new();
for (@test){
$m->parse($_->[0]);
is join('|', $m->variables()),$_->[1], "Extracted variables for '$_->[0]'";
}
# vim: sw=4 ts=4 expandtab syn=perl