6 use Test::More tests => 3 * (2 * 1);
11 my ($n, $force_use) = @_;
16 my $stmt = $use ? 'use indirect;' : 'no indirect;';
17 $use = !$use unless defined $force_use;
18 push @lines, "{ $stmt }";
21 return '{ no indirect; ', @lines, '}';
24 for my $test ([ 1, 'always use' ], [ 0, 'always no' ], [ undef, 'mixed' ]) {
25 my ($force_use, $desc) = @$test;
26 my $code = join "\n", linear $n, $force_use;
29 local $SIG{__WARN__} = sub { push @warns, "@_" };
34 is $err, '', "linear ($desc): no errror";
35 is @warns, 0, "linear ($desc): no warnings";