chore: update test
This commit is contained in:
parent
c436897662
commit
76f5f81aee
2 changed files with 11 additions and 2 deletions
|
|
@ -429,7 +429,12 @@ fn set_included_ranges(parser: &mut Parser, input: &[u8], delimiters: Option<(&s
|
|||
let mut ranges = Vec::new();
|
||||
let mut ix = 0;
|
||||
while ix < input.len() {
|
||||
let Some(mut start_ix) = input[ix..].windows(2).position(|win| win == start.as_bytes()) else { break };
|
||||
let Some(mut start_ix) = input[ix..]
|
||||
.windows(2)
|
||||
.position(|win| win == start.as_bytes())
|
||||
else {
|
||||
break;
|
||||
};
|
||||
start_ix += ix + start.len();
|
||||
let end_ix = input[start_ix..]
|
||||
.windows(2)
|
||||
|
|
|
|||
|
|
@ -252,9 +252,13 @@ fn test_node_parent_of_child_by_field_name() {
|
|||
fn test_node_field_name_for_child() {
|
||||
let mut parser = Parser::new();
|
||||
parser.set_language(get_language("c")).unwrap();
|
||||
let tree = parser.parse("x + y;", None).unwrap();
|
||||
let tree = parser.parse("void main() { x + y; }", None).unwrap();
|
||||
let translation_unit_node = tree.root_node();
|
||||
let binary_expression_node = translation_unit_node
|
||||
.named_child(0)
|
||||
.unwrap()
|
||||
.named_child(2)
|
||||
.unwrap()
|
||||
.named_child(0)
|
||||
.unwrap()
|
||||
.named_child(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue