Skip to content

Commit eeb2e5b

Browse files
committed
Add a test involving byte order mark
Currently fails with: thread 'byte_order_mark' panicked at 'called `Result::unwrap()` on an `Err` value: LexError { span: Span }', tests/test.rs:637:48
1 parent f26128d commit eeb2e5b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,3 +630,13 @@ fn check_spans_internal(ts: TokenStream, lines: &mut &[(usize, usize, usize, usi
630630
}
631631
}
632632
}
633+
634+
#[test]
635+
fn byte_order_mark() {
636+
let string = "\u{feff}foo";
637+
let tokens = string.parse::<TokenStream>().unwrap();
638+
match tokens.into_iter().next().unwrap() {
639+
TokenTree::Ident(ident) => assert_eq!(ident, "foo"),
640+
_ => unreachable!(),
641+
}
642+
}

0 commit comments

Comments
 (0)