Skip to content

Commit

Permalink
test: additional parse index tests
Browse files Browse the repository at this point in the history
  • Loading branch information
viddrobnic committed May 28, 2024
1 parent ac80e6f commit c442271
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions parser/src/parser/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,46 @@ fn index() -> Result<()> {
},
},
),
(
"a.b.c",
ast::Node {
value: ast::NodeValue::Index {
left: Box::new(ast::Node {
value: ast::NodeValue::Index {
left: Box::new(ast::Node {
value: ast::NodeValue::Identifier("a".to_string()),
range: Range {
start: Position::new(0, 0),
end: Position::new(0, 1),
},
}),
index: Box::new(ast::Node {
value: ast::NodeValue::StringLiteral("b".to_string()),
range: Range {
start: Position::new(0, 2),
end: Position::new(0, 3),
},
}),
},
range: Range {
start: Position::new(0, 0),
end: Position::new(0, 3),
},
}),
index: Box::new(ast::Node {
value: ast::NodeValue::StringLiteral("c".to_string()),
range: Range {
start: Position::new(0, 4),
end: Position::new(0, 5),
},
}),
},
range: Range {
start: Position::new(0, 0),
end: Position::new(0, 5),
},
},
),
];

for (input, expected) in tests {
Expand Down

0 comments on commit c442271

Please sign in to comment.