Skip to content

Commit

Permalink
verify the core try logic is also available via feature.pm
Browse files Browse the repository at this point in the history
  • Loading branch information
wchristian committed Dec 26, 2022
1 parent 1eb57ec commit 381ec2f
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion t/feature_tracking.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use lib 't/lib';
use PPI::Test::pragmas;
use Test::More tests => 7 + ( $ENV{AUTHOR_TESTING} ? 1 : 0 );
use Test::More tests => 8 + ( $ENV{AUTHOR_TESTING} ? 1 : 0 );

use B 'perlstring';

Expand Down Expand Up @@ -216,6 +216,31 @@ END_PERL
};
}

CORE_TRY: {
test_document
<<'END_PERL',
use feature "try";
try{}catch{}
END_PERL
[
'PPI::Statement::Include' => 'use feature "try";',
'PPI::Token::Word' => 'use',
'PPI::Token::Word' => 'feature',
'PPI::Token::Quote::Double' => '"try"',
'PPI::Token::Structure' => ';',
'PPI::Statement::Compound' => 'try{}catch{}',
'PPI::Token::Word' => 'try',
'PPI::Structure::Block' => '{}',
'PPI::Token::Structure' => '{',
'PPI::Token::Structure' => '}',
'PPI::Token::Word' => 'catch',
'PPI::Structure::Block' => '{}',
'PPI::Token::Structure' => '{',
'PPI::Token::Structure' => '}',
],
"core try";
}

### TODO from ppi_token_unknown.t , deduplicate

sub one_line_explain {
Expand Down

0 comments on commit 381ec2f

Please sign in to comment.