File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -268,11 +268,12 @@ fn literal_parse() {
268
268
fn literal_span ( ) {
269
269
let positive = "0.1" . parse :: < Literal > ( ) . unwrap ( ) ;
270
270
let negative = "-0.1" . parse :: < Literal > ( ) . unwrap ( ) ;
271
+ let subspan = positive. subspan ( 1 ..2 ) ;
271
272
272
273
#[ cfg( not( span_locations) ) ]
273
274
{
274
- let _ = positive;
275
275
let _ = negative;
276
+ assert ! ( subspan. is_none( ) ) ;
276
277
}
277
278
278
279
#[ cfg( span_locations) ]
@@ -281,7 +282,10 @@ fn literal_span() {
281
282
assert_eq ! ( positive. span( ) . end( ) . column, 3 ) ;
282
283
assert_eq ! ( negative. span( ) . start( ) . column, 0 ) ;
283
284
assert_eq ! ( negative. span( ) . end( ) . column, 4 ) ;
285
+ assert_eq ! ( subspan. unwrap( ) . source_text( ) . unwrap( ) , "." ) ; // FIXME
284
286
}
287
+
288
+ assert ! ( positive. subspan( 1 ..4 ) . is_none( ) ) ;
285
289
}
286
290
287
291
#[ test]
You can’t perform that action at this time.
0 commit comments