Skip to content

Commit

Permalink
Add regression test for issue 410
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 8, 2023
1 parent 12eddc0 commit 4c0bd28
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,17 @@ fn literal_span() {
#[cfg(span_locations)]
#[test]
fn source_text() {
let input = " 𓀕 ";
let tokens = input.parse::<proc_macro2::TokenStream>().unwrap();
let ident = tokens.into_iter().next().unwrap();
let input = " 𓀕 c ";
let mut tokens = input
.parse::<proc_macro2::TokenStream>()
.unwrap()
.into_iter();

let ident = tokens.next().unwrap();
assert_eq!("𓀕", ident.span().source_text().unwrap());

let ident = tokens.next().unwrap();
assert_eq!("c", ident.span().source_text().unwrap()); // FIXME
}

#[test]
Expand Down

0 comments on commit 4c0bd28

Please sign in to comment.