mirror of
https://github.com/danog/parser.git
synced 2024-11-26 20:04:57 +01:00
parser/tests: group use with alias
This commit is contained in:
parent
a99b62155a
commit
e7d4900a02
@ -5341,6 +5341,17 @@ mod tests {
|
||||
]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn simple_group_use_with_alias() {
|
||||
assert_ast("<?php use Foo\\{Bar, Baz as Bob, Car};", &[
|
||||
Statement::GroupUse { prefix: "Foo\\".into(), kind: crate::UseKind::Normal, uses: vec![
|
||||
Use { name: "Bar".into(), alias: None },
|
||||
Use { name: "Baz".into(), alias: Some("Bob".into()) },
|
||||
Use { name: "Car".into(), alias: None }
|
||||
]}
|
||||
]);
|
||||
}
|
||||
|
||||
fn assert_ast(source: &str, expected: &[Statement]) {
|
||||
let mut lexer = Lexer::new(None);
|
||||
let tokens = lexer.tokenize(source).unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user