Skip to content

Commit

Permalink
add test to ensure T_FN backfill is applied correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto committed Mar 19, 2021
1 parent 71bed8b commit 128a997
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Core/Tokenizer/AttributesTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ function attribute_on_function_test() {}
#[AttributeWithParams('foo', bar: ['bar' => 'foobar'])]
function attribute_with_params_on_function_test() {}

/* testAttributeWithShortClosureParameter */
#[AttributeWithParams(static fn ($value) => ! $value)]
function attribute_with_short_closure_param_test() {}

/* testTwoAttributeOnTheSameLine */
#[CustomAttribute] #[AttributeWithParams('foo')]
function two_attribute_on_same_line_test() {}
Expand Down
22 changes: 22 additions & 0 deletions tests/Core/Tokenizer/AttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,28 @@ public function dataAttribute()
T_CLOSE_PARENTHESIS,
],
],
[
'/* testAttributeWithShortClosureParameter */',
17,
[
T_STRING,
T_OPEN_PARENTHESIS,
T_STATIC,
T_WHITESPACE,
T_FN,
T_WHITESPACE,
T_OPEN_PARENTHESIS,
T_VARIABLE,
T_CLOSE_PARENTHESIS,
T_WHITESPACE,
T_FN_ARROW,
T_WHITESPACE,
T_BOOLEAN_NOT,
T_WHITESPACE,
T_VARIABLE,
T_CLOSE_PARENTHESIS,
],
],
[
'/* testAttributeGrouping */',
26,
Expand Down

0 comments on commit 128a997

Please sign in to comment.