Skip to content

Commit 6461c2d

Browse files
committed
Add out-of-order call to source_text test
1 parent c4c3251 commit 6461c2d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/test.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,17 +328,19 @@ fn literal_span() {
328328
#[cfg(span_locations)]
329329
#[test]
330330
fn source_text() {
331-
let input = " 𓀕 c ";
331+
let input = " 𓀕 a z ";
332332
let mut tokens = input
333333
.parse::<proc_macro2::TokenStream>()
334334
.unwrap()
335335
.into_iter();
336336

337-
let ident = tokens.next().unwrap();
338-
assert_eq!("𓀕", ident.span().source_text().unwrap());
337+
let first = tokens.next().unwrap();
338+
assert_eq!("𓀕", first.span().source_text().unwrap());
339339

340-
let ident = tokens.next().unwrap();
341-
assert_eq!("c", ident.span().source_text().unwrap());
340+
let second = tokens.next().unwrap();
341+
let third = tokens.next().unwrap();
342+
assert_eq!("z", third.span().source_text().unwrap());
343+
assert_eq!("a", second.span().source_text().unwrap());
342344
}
343345

344346
#[test]

0 commit comments

Comments
 (0)