From 76f5f81aee241071c35298f2ca9915e9ec0b863d Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Tue, 18 Jul 2023 19:29:40 -0400 Subject: [PATCH] chore: update test --- cli/src/tests/corpus_test.rs | 7 ++++++- cli/src/tests/node_test.rs | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cli/src/tests/corpus_test.rs b/cli/src/tests/corpus_test.rs index b818b2c1..0bd1db88 100644 --- a/cli/src/tests/corpus_test.rs +++ b/cli/src/tests/corpus_test.rs @@ -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) diff --git a/cli/src/tests/node_test.rs b/cli/src/tests/node_test.rs index e7b9640b..9dd8a1c2 100644 --- a/cli/src/tests/node_test.rs +++ b/cli/src/tests/node_test.rs @@ -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)