mirror of
https://github.com/danog/parser.git
synced 2025-01-22 21:11:55 +01:00
parser: add test case for static arrow functions returning by ref
This commit is contained in:
parent
05aff40752
commit
81f5719fd5
@ -3972,6 +3972,20 @@ mod tests {
|
||||
]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn static_arrow_functions_returning_by_ref() {
|
||||
assert_ast(
|
||||
"<?php static fn &() => null;",
|
||||
&[expr!(Expression::ArrowFunction {
|
||||
params: vec![],
|
||||
expr: Box::new(Expression::Null),
|
||||
return_type: None,
|
||||
by_ref: true,
|
||||
r#static: true,
|
||||
})],
|
||||
);
|
||||
}
|
||||
|
||||
fn assert_ast(source: &str, expected: &[Statement]) {
|
||||
let mut lexer = Lexer::new(None);
|
||||
let tokens = lexer.tokenize(source).unwrap();
|
||||
|
Loading…
x
Reference in New Issue
Block a user