use strict;
use warnings;
-use Test::More tests => 2 * 4 * 7;
+use Test::More;
use B::RecDeparse;
[ e3 => 'foo(@_)', '123' ],
[ e4 => 'foo(shift)', '123' ],
- [ x1 => 'bar()', 'bar' ],
- [ x2 => 'bar(1)', 'bar' ],
- [ x3 => 'bar(@_)', 'bar' ],
- [ x4 => 'bar(shift)', 'bar' ],
+ [ n1 => 'bar()', 'bar' ],
+ [ n2 => 'bar(1)', 'bar' ],
+ [ n3 => 'bar(@_)', 'bar' ],
+ [ n4 => 'bar(shift)', 'bar' ],
[ d1 => 'baz()', 'baz' ],
[ d2 => 'baz(1)', 'baz' ],
[ m12 => 'shift->qux(shift)', 'qux' ],
);
+if (eval 'use List::Util qw<sum>; 1') {
+ push @tests, (
+ [ x1 => 'sum()', 'sum' ],
+ [ x2 => 'sum(1)', 'sum' ],
+ [ x3 => 'sum(@_)', 'sum' ],
+ [ x4 => 'sum(shift)', 'sum' ],
+ );
+}
+
+plan tests => 2 * @tests;
+
for my $test (@tests) {
my ($name, $source, $match) = @$test;