|
#!/usr/bin/env perl
use Test::More import => [ qw( done_testing is ok ) ]; my $filename = 'test-data/quoted-var.pl' ;
my $content = path( $filename )->slurp;
my $doc = PPI::Document->new( \ $content );
my $includes = $doc ->find(
sub {
$_ [1]->isa( 'PPI::Statement::Include' );
}
) || [];
my $e = source2pi(
$filename ,
undef ,
{ include => $includes ->[2] },
);
ok( ! $e ->_is_ignored, 'is not ignored' );
is(
$e ->formatted_ppi_statement,
'use IO::Uncompress::Gunzip qw( $GunzipError );' ,
'var is detected inside of quotes'
);
done_testing();
|