Skip to content

Commit

Permalink
Add source_text() test with mulitbyte char
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 6, 2023
1 parent 07bb590 commit 4fe2326
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,15 @@ fn literal_span() {
assert!(positive.subspan(1..4).is_none());
}

#[cfg(span_locations)]
#[test]
fn source_text() {
let input = " 𓀕 ";
let tokens = input.parse::<proc_macro2::TokenStream>().unwrap();
let ident = tokens.into_iter().next().unwrap();
assert_eq!("𓀕", ident.span().source_text().unwrap()); // FIXME
}

#[test]
fn roundtrip() {
fn roundtrip(p: &str) {
Expand Down

0 comments on commit 4fe2326

Please sign in to comment.