Skip to content

Commit

Permalink
switch from clear prototypes to ambiguous ones in signature testing
Browse files Browse the repository at this point in the history
Under signature regime, most prototypes are just complete nonsense, and we
care about testing whether the switches work. As such, using a form that
can be both a prototype and a signature helps test better.
  • Loading branch information
wchristian committed Nov 19, 2024
1 parent a23005d commit 3d23b3a
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions t/feature_tracking.t
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ sub test_document;
FEATURE_TRACKING: {
test_document
<<'END_PERL',
sub meep(&$) {}
sub meep($) {}
use 5.035;
sub marp($left, $right) {}
END_PERL
[
'PPI::Statement::Sub' => 'sub meep(&$) {}',
'PPI::Statement::Sub' => 'sub meep($) {}',
'PPI::Token::Word' => 'sub',
'PPI::Token::Word' => 'meep',
'PPI::Token::Prototype' => '(&$)',
'PPI::Token::Prototype' => '($)',
'PPI::Structure::Block' => '{}',
'PPI::Token::Structure' => '{',
'PPI::Token::Structure' => '}',
Expand All @@ -51,14 +51,14 @@ DOCUMENT_FEATURES: {
test_document
[ feature_mods => { signatures => 1 } ],
<<'END_PERL',
sub meep(&$) {}
sub meep($) {}
sub marp($left, $right) {}
END_PERL
[
'PPI::Statement::Sub' => 'sub meep(&$) {}',
'PPI::Statement::Sub' => 'sub meep($) {}',
'PPI::Token::Word' => 'sub',
'PPI::Token::Word' => 'meep',
'PPI::Token::Signature' => '(&$)',
'PPI::Token::Signature' => '($)',
'PPI::Structure::Block' => '{}',
'PPI::Token::Structure' => '{',
'PPI::Token::Structure' => '}',
Expand All @@ -77,15 +77,15 @@ DISABLE_FEATURE: {
test_document
[ feature_mods => { signatures => 1 } ],
<<'END_PERL',
sub meep(&$) {}
sub meep($) {}
no feature 'signatures';
sub marp($left, $right) {}
END_PERL
[
'PPI::Statement::Sub' => 'sub meep(&$) {}',
'PPI::Statement::Sub' => 'sub meep($) {}',
'PPI::Token::Word' => 'sub',
'PPI::Token::Word' => 'meep',
'PPI::Token::Signature' => '(&$)',
'PPI::Token::Signature' => '($)',
'PPI::Structure::Block' => '{}',
'PPI::Token::Structure' => '{',
'PPI::Token::Structure' => '}',
Expand All @@ -108,14 +108,14 @@ END_PERL
PROTOTYPE_ATTR: {
test_document
<<'END_PERL',
sub meep :prototype(&$) {}
sub meep :prototype($) {}
END_PERL
[
'PPI::Statement::Sub' => 'sub meep :prototype(&$) {}',
'PPI::Statement::Sub' => 'sub meep :prototype($) {}',
'PPI::Token::Word' => 'sub',
'PPI::Token::Word' => 'meep',
'PPI::Token::Operator' => ':',
'PPI::Token::Attribute' => 'prototype(&$)',
'PPI::Token::Attribute' => 'prototype($)',
'PPI::Structure::Block' => '{}',
'PPI::Token::Structure' => '{',
'PPI::Token::Structure' => '}',
Expand Down Expand Up @@ -177,18 +177,18 @@ HOMEBREW_ARGS: {
[ custom_feature_includes => { strEct => { signatures => 1 } } ],
<<'END_PERL',
use strEct;
sub meep(&$) {}
sub meep($) {}
sub marp($left, $right) {}
END_PERL
[
'PPI::Statement::Include' => 'use strEct;',
'PPI::Token::Word' => 'use',
'PPI::Token::Word' => 'strEct',
'PPI::Token::Structure' => ';',
'PPI::Statement::Sub' => 'sub meep(&$) {}',
'PPI::Statement::Sub' => 'sub meep($) {}',
'PPI::Token::Word' => 'sub',
'PPI::Token::Word' => 'meep',
'PPI::Token::Signature' => '(&$)',
'PPI::Token::Signature' => '($)',
'PPI::Structure::Block' => '{}',
'PPI::Token::Structure' => '{',
'PPI::Token::Structure' => '}',
Expand Down Expand Up @@ -216,7 +216,7 @@ HOMEBREW_CB: {
],
<<'END_PERL',
use strEct "sigg";
sub meep(&$) {}
sub meep($) {}
sub marp($left, $right) {}
END_PERL
[
Expand All @@ -225,10 +225,10 @@ END_PERL
'PPI::Token::Word' => 'strEct',
'PPI::Token::Quote::Double' => '"sigg"',
'PPI::Token::Structure' => ';',
'PPI::Statement::Sub' => 'sub meep(&$) {}',
'PPI::Statement::Sub' => 'sub meep($) {}',
'PPI::Token::Word' => 'sub',
'PPI::Token::Word' => 'meep',
'PPI::Token::Signature' => '(&$)',
'PPI::Token::Signature' => '($)',
'PPI::Structure::Block' => '{}',
'PPI::Token::Structure' => '{',
'PPI::Token::Structure' => '}',
Expand Down

0 comments on commit 3d23b3a

Please sign in to comment.