Ensure nodes are aliased consistently within syntax error nodes
Co-Authored-By: Rick Winfrey <rewinfrey@github.com>
This commit is contained in:
parent
a7125feb49
commit
a2d760e426
5 changed files with 330 additions and 236 deletions
|
|
@ -367,6 +367,30 @@ fn test_query_errors_on_impossible_patterns() {
|
|||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_query_verifies_possible_patterns_with_aliased_parent_nodes() {
|
||||
allocations::record(|| {
|
||||
let ruby = get_language("ruby");
|
||||
|
||||
Query::new(ruby, "(destructured_parameter (identifier))").unwrap();
|
||||
|
||||
assert_eq!(
|
||||
Query::new(ruby, "(destructured_parameter (string))",),
|
||||
Err(QueryError {
|
||||
kind: QueryErrorKind::Structure,
|
||||
row: 0,
|
||||
offset: 24,
|
||||
column: 24,
|
||||
message: [
|
||||
"(destructured_parameter (string))", //
|
||||
" ^",
|
||||
]
|
||||
.join("\n")
|
||||
})
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_query_matches_with_simple_pattern() {
|
||||
allocations::record(|| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue