File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ pub fn query_files_at_paths(
5757 ) ?;
5858 results. push ( query_testing:: CaptureInfo {
5959 name : capture_name. to_string ( ) ,
60- position : capture. node . start_position ( ) ,
61- terminus : capture. node . end_position ( ) ,
60+ start : capture. node . start_position ( ) ,
61+ end : capture. node . end_position ( ) ,
6262 } ) ;
6363 }
6464 } else {
@@ -85,8 +85,8 @@ pub fn query_files_at_paths(
8585 }
8686 results. push ( query_testing:: CaptureInfo {
8787 name : capture_name. to_string ( ) ,
88- position : capture. node . start_position ( ) ,
89- terminus : capture. node . end_position ( ) ,
88+ start : capture. node . start_position ( ) ,
89+ end : capture. node . end_position ( ) ,
9090 } ) ;
9191 }
9292 }
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ lazy_static! {
1212#[ derive( Debug , Eq , PartialEq ) ]
1313pub struct CaptureInfo {
1414 pub name : String ,
15- pub position : Point ,
16- pub terminus : Point ,
15+ pub start : Point ,
16+ pub end : Point ,
1717}
1818
1919#[ derive( Debug , PartialEq , Eq ) ]
@@ -136,16 +136,14 @@ pub fn assert_expected_captures(
136136 let pairs = parse_position_comments ( parser, language, contents. as_bytes ( ) ) ?;
137137 for info in & infos {
138138 let found = pairs. iter ( ) . find ( |p| {
139- p. position . row == info. position . row
140- && p. position >= info. position
141- && p. position < info. terminus
139+ p. position . row == info. start . row && p. position >= info. start && p. position < info. end
142140 } ) ;
143141
144142 if let Some ( found) = found {
145143 if found. expected_capture_name != info. name && info. name != "name" {
146144 Err ( error:: Error :: new ( format ! (
147145 "Assertion failed: at {}, found {}, expected {}" ,
148- info. position , found. expected_capture_name, info. name
146+ info. start , found. expected_capture_name, info. name
149147 ) ) ) ?
150148 }
151149 }
You can’t perform that action at this time.
0 commit comments